Skilllibrary game-ui-hud
Implements game UI and HUD systems including health bars, minimaps, menus, inventory screens, and responsive layouts. Use when building HUD elements, menu systems, screen-space or world-space UI, UI animation, input focus navigation, accessibility features, or optimizing canvas/widget performance in Unity, Unreal, or Godot.
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/13-game-engines-and-creative-tech/game-ui-hud" ~/.claude/skills/merceralex397-collab-skilllibrary-game-ui-hud && rm -rf "$T"
manifest:
13-game-engines-and-creative-tech/game-ui-hud/SKILL.mdsource content
Purpose
Build and optimize game UI and HUD systems: in-game overlays (health, ammo, minimap), menu screens (main, pause, settings, inventory), responsive layouts, world-space UI, animation/juice, multi-input support, accessibility, and rendering performance.
When to use this skill
- Building HUD elements: health bars, ammo counters, minimaps, crosshairs, status icons
- Creating menu systems: main menu, pause, settings, inventory, shop screens
- Implementing UI in Unity (UI Toolkit or UGUI), UE5 (UMG/Widget Blueprints), or Godot (Control nodes)
- Making UI responsive across resolutions, aspect ratios, and safe areas
- Adding world-space UI: damage numbers, nameplates, interaction prompts
- Implementing UI animation, tweening, and micro-interactions
- Supporting multiple input methods (mouse, gamepad, touch) with focus navigation
- Adding accessibility: colorblind modes, text scaling, screen reader hooks
Do not use this skill when
- The task is about game mechanics or balance math — use
game-design-systems - The task is about web/app UI with no game engine — use standard frontend skills
- The task is about 3D rendering or shaders — use
shader-vfx - The task is about asset import/compression for UI sprites — use
asset-pipeline
Operating procedure
- Choose the UI framework:
- Unity UI Toolkit: USS (styling) + UXML (structure), data binding,
hierarchy. Preferred for new Unity projects.VisualElement - Unity UGUI:
+Canvas
,RectTransform
,Image
/Text
,TextMeshPro
. Mature, wide community support.Button - UE5 UMG: Widget Blueprints,
,UUserWidget
/UHorizontalBox
/UVerticalBox
, bind toUOverlay
.UMG Animation - Godot:
node tree,Control
/VBoxContainer
,HBoxContainer
resources,Theme
,Label
.TextureRect
- Unity UI Toolkit: USS (styling) + UXML (structure), data binding,
- Design the HUD layer:
- Health bar: use a filled
(Unity) orImage
(UE5) bound toProgressBar
. Tween color from green → yellow → red.currentHP / maxHP - Minimap: render a top-down camera to
(Unity) orRenderTexture
(UE5), display as circular masked UI element.SceneCaptureComponent2D - Ammo counter: bind text to weapon data, flash on low ammo (<20%), pulse on reload.
- Crosshair: screen-center overlay, scale with movement accuracy, hide during ADS.
- Health bar: use a filled
- Build menu systems:
- Use a UI Manager singleton to control screen stack:
,Push(screen)
,Pop()
. Only the top screen receives input.PopToRoot() - Main menu: Play, Settings, Credits, Quit. Animate transitions with slide or fade (200–400ms).
- Pause menu: freeze
(Unity) orTime.timeScale = 0
(UE5). Ensure UI animations use unscaled time.SetGamePaused(true) - Settings: resolution dropdown, fullscreen toggle, volume sliders, key rebinding. Save to
(Unity) orPlayerPrefs
(UE5).GameUserSettings
- Use a UI Manager singleton to control screen stack:
- Make UI responsive:
- Set canvas to
(Unity) at reference 1920×1080, match 0.5 width/height.Scale With Screen Size - Anchor HUD elements to screen edges (health=bottom-left, minimap=top-right).
- Respect safe areas on mobile/console: use
(Unity) orScreen.safeArea
(UE5).GetDisplayMetrics - Support 16:9, 21:9, and 4:3 — test with letterboxing and pillarboxing.
- Set canvas to
- Implement world-space UI:
- Damage numbers: spawn
(Unity) orTextMeshPro
(UE5) at hit point, animate upward with fade-out over 0.8s. Pool instances.UWidgetComponent - Nameplates: attach
to actor, billboard toward camera, fade by distance.WorldSpace Canvas - Interaction prompts: show "Press E" when player overlaps trigger, hide on exit. Swap icon based on active input device.
- Damage numbers: spawn
- Add animation and juice:
- Use tweening (DOTween in Unity, UMG animations in UE5,
in Godot) for all transitions.Tween - Micro-interactions: button scale on hover (1.0 → 1.05, 100ms), click punch (1.05 → 0.95 → 1.0).
- Screen shake on damage: offset camera or UI parent by random amount, decay over 0.3s.
- Number countup for score changes: interpolate displayed value over 0.5s.
- Use tweening (DOTween in Unity, UMG animations in UE5,
- Handle multi-input and focus:
- Detect active input device: if gamepad input received, switch to focus-based navigation and show gamepad icons.
- Set
(Unity) orfirstSelectedGameObject
(UE5) when opening a menu.SetKeyboardFocus - Ensure all interactive elements are navigable via D-pad/stick.
- For touch: increase hit targets to minimum 44×44dp, add touch feedback ripple.
- Implement accessibility:
- Colorblind mode: provide icon/shape differentiation in addition to color. Offer Deuteranopia/Protanopia/Tritanopia filters.
- Text scaling: support 80%–150% UI scale slider. Screen reader: tag elements with
(UE5).AccessibleText
- Optimize performance:
- Unity UGUI: split canvases (static HUD vs dynamic elements) to reduce rebuild cost. Disable
on non-interactive elements. UseRaycast Target
profiler marker.Canvas.willRenderCanvases - UE5 UMG: use widget pooling (pre-create and show/hide) instead of Create/Destroy. Mark static widgets
.IsVolatile = false - All engines: use dirty-flag redraw — only update elements when underlying data changes, not every frame.
- Batch draw calls: use texture atlases for UI sprites, minimize unique materials.
- Unity UGUI: split canvases (static HUD vs dynamic elements) to reduce rebuild cost. Disable
Decision rules
- Prefer UI Toolkit over UGUI for new Unity projects (better performance, CSS-like styling).
- Always use TextMeshPro (Unity) or UMG RichText (UE5) — never legacy
component.Text - Split HUD into separate canvases/widgets by update frequency (health = event-driven, timer = per-second, FPS = per-frame).
- World-space UI must be pooled if >20 instances are possible (damage numbers, nameplates).
- All UI text must go through localization system from day one — never hardcode strings.
- Every interactive element must be reachable by both mouse/touch and gamepad.
Output requirements
— all UI screens with hierarchy (HUD, MainMenu, Pause, Settings, Inventory)Screen List
— anchoring, reference resolution, safe area handlingLayout Spec
— each element with data binding source and update frequencyWidget/Element List
— tween targets, durations, easing curves for transitionsAnimation Spec
— how each screen handles mouse, gamepad, and touchInput Map
— colorblind support, text scaling, focus orderAccessibility Checklist
— target draw calls for UI, max canvas rebuilds per framePerformance Budget
References
- Unity:
(USS/UXML),UI Toolkit
,Canvas
,TextMeshPro
,EventSystemDOTween - UE5:
,UUserWidget
,UWidgetComponent
,UMG Animation
pluginCommonUI - Godot 4:
,Control
,Theme
nodes,ContainerSceneTreeTween - Xbox Accessibility Guidelines (XAG), Google Material Design touch targets (48dp min)
Related skills
— UI displays progression, economy, and loot datagame-design-systems
— UI sprite atlases and texture optimizationasset-pipeline
— UE5 widget Blueprints and event bindingblueprint-patterns
— input device detection feeds UI icon swappinginput-mapping-controller
Failure handling
- If UI feels sluggish, profile canvas rebuild frequency (Unity) or widget tick cost (UE5) and split/pool accordingly.
- If layout breaks at extreme aspect ratios, add anchored fallback positions and test 21:9 and 32:9.
- If gamepad navigation skips elements, verify focus order and set explicit navigation targets.
- If draw calls from UI exceed budget, consolidate sprites into atlases and reduce unique materials.