dreamteam-hq/brigid/gamedev-2d-ui

Claude Code and agent skill by dreamteam-hq/brigid

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Game UI/HUD patterns in Godot 4 — health bars, inventory, dialog systems, damage numbers, menus, and multiplayer UI. Load when building game interfaces, HUD overlays, inventory screens, dialog boxes, or settings menus, or when the user mentions "game UI", "HUD", "health bar", "mana bar", "inventory", "dialog system", "damage numbers", "floating text", "game menu", "pause menu", "settings menu", "key rebinding", "multiplayer UI", "nameplates", "party frames", "trade window", "lobby browser", "Go…

Install

npx vskill@latest install dreamteam-hq/brigid/gamedev-2d-ui

SKILL.md

The same SKILL.md was published earlier as dreamteam-hq/brigid/gamedev-2d-ui.

Game UI/HUD Patterns (Godot 4)

Control Node Fundamentals

CanvasLayer for HUD Separation

All game UI belongs on a CanvasLayer so it renders independently of the game world camera.

GameWorld (Node2D)
├── Camera2D
└── ...
HUDLayer (CanvasLayer, layer = 10)
└── HUD (Control)
MenuLayer (CanvasLayer, layer = 20)
└── PauseMenu
TooltipLayer (CanvasLayer, layer = 30)
└── TooltipPanel

Higher layer numbers render on top. Use distinct layers: HUD (10), floating text (15), menus (20), tooltips (30), transitions (100).

Anchoring and Margins
Anchor PresetAnchorsUse Case
Top-Leftall 0.0Health bar, player portrait
Top-Rightleft/right = 1.0, top = 0.0Minimap, currency display
Bottom-Centerleft = 0.5, right = 0.5, bottom = 1.0Action bar, XP bar
Full Rectall corners fillPause menu overlay, dialog backdrop
Centerall 0.5Popup dialogs, item comparison

For responsive layouts that adapt to resolution changes, use Container nodes (HBoxContainer, VBoxContainer, MarginContainer) rather than hardcoding pixel offsets.

Theme Resources

Create a shared Theme resource for consistent styling. Apply at the root Control node — all children inherit automatically. Theme defines fonts, colors, styleboxes, and spacing for every Control type.

HUD Elements

Key HUD components:

  • Health/Mana bars: TextureProgressBar for polished, ProgressBar + theme overrides for quick prototyping. Use smooth lerp to target value. Layered bars for damage-flash effect.
  • Minimap: SubViewportContainer → SubViewport → Camera2D following player at low zoom.
  • Buff icons: TextureRect + timer overlay with radial cooldown shader progress.
  • XP bar: ProgressBar anchored bottom center showing level + current/max XP.
  • Currency: Animated counter that smoothly interpolates displayed value toward target.

See references/gdscript-implementations.md for full implementations of all HUD components.

Inventory UI

Grid-Based Inventory

Use GridContainer (columns = 8) to lay out inventory slots. Each slot is a PanelContainer with icon and stack count label.

Drag and drop: Godot's built-in _get_drag_data, _can_drop_data, _drop_data on Control nodes. Always set set_drag_preview() with a visual clone of the item.

Tooltip: Autoload on a high CanvasLayer (layer = 30). Always clamp tooltip position to viewport bounds.

Equipment Slots

Named slots (not a grid). Map body parts to slot containers.

SlotAccepts
HeadHelmets, crowns
ChestArmor, robes
LegsPants, greaves
Main HandSwords, staffs
Off HandShields, orbs
Ring 1/2Rings
AmuletNecklaces

Equipment slots reuse the drag-and-drop interface but add type checking in _can_drop_data:

gdscript
return data["item"].get("equip_slot", "") == slot_type

Item comparison: On hover over equippable, show side-by-side stats with color-coded diffs (green = upgrade, red = downgrade).

See references/gdscript-implementations.md for inventory grid, slot, and tooltip implementations.

Dialog System

RichTextLabel with BBCode
TagEffectUse Case
[b]...[/b]BoldSpeaker names, important words
[i]...[/i]ItalicThoughts, flavor text
[color=#hex]...[/color]Text colorNPC name colors, keyword highlights
[wave amp=30 freq=4]...[/wave]Wavy textMagical speech
[shake rate=20 level=5]...[/shake]Shaking textAnger, fear
[img]res://icon.png[/img]Inline imageItem icons, button prompts
[hint=tooltip text]...[/hint]Hover tooltipLore terms, item references
Key Dialog Patterns
  • Typewriter effect: Use visible_characters on RichTextLabel, incrementing at characters_per_second. Emit line_finished signal when complete. Allow player to skip via ui_accept.
  • Portrait display: TextureRect that swaps texture based on speaker + emotion.
  • Branching dialog trees: Store in external JSON files — separates content from logic, enables localization. Dialog manager autoload processes the tree and handles conditional choices.

See references/gdscript-implementations.md for typewriter and dialog manager implementations.

Damage Numbers

Spawn Label nodes at the damage location on a dedicated CanvasLayer (layer = 15), animate upward with a tween, then free. Use a spawner autoload for world→screen position conversion.

Damage type color reference:

Damage TypeColorHex
PhysicalWhite#FFFFFF
FireOrange-red#FF6619
IceLight blue#4DB3FF
PoisonGreen#33E633
HealBright green#33FF66
CritGold#FFD900
Miss/DodgeGray#888888

Crits: larger font (28px vs 18px), "!" suffix, scale pop animation.

See references/gdscript-implementations.md for full damage number and spawner implementations.

Menus

Main Menu

VBoxContainer of Buttons inside CenterContainer. Disable Continue button if no save exists.

Pause Menu

Set get_tree().paused = true. The pause menu's process_mode must be PROCESS_MODE_WHEN_PAUSED to still receive input. Toggle visibility on pause action.

Settings Menu

Organize into tabs using TabContainer:

  • Audio: HSlider per bus → AudioServer.set_bus_volume_db() with linear_to_db()
  • Video: Fullscreen toggle, VSync toggle, resolution OptionButton → DisplayServer
  • Controls: Key rebinding using InputMap — list actions, capture new InputEventKey, call action_erase_events + action_add_event
Screen Transitions

ColorRect with AnimationPlayer on persistent CanvasLayer (layer = 100). Autoload: change_scene(path) plays fade_out → changes scene → plays fade_in.

See references/gdscript-implementations.md for settings and transition implementations.

Multiplayer UI

Nameplates

Label on CanvasLayer that follows entity. Convert world position to screen space using camera offset. Color by relationship:

RelationshipColorHex
SelfWhite#FFFFFF
Party memberBlue#4488FF
Friendly NPCGreen#44CC44
Hostile playerRed#FF4444
NeutralYellow#CCCC44
Party Frames

VBoxContainer of compact HBoxContainer rows (portrait + name + HP bar + MP bar). Update via signals from player data changes.

Trade Window

Two-panel layout. Both players must confirm before trade executes. Reset confirmation state when either side changes their offer.

Chat Input

LineEdit + OptionButton for channels. Hidden until chat_open action. Support /p and /w prefix commands for party/whisper.

Lobby Browser

VBoxContainer or ItemList of server rows. Async refresh, click-to-select, join button.

See references/gdscript-implementations.md for nameplate, trade window, and chat implementations.

Godot MCP Integration

UI Scene Scaffolding Workflows

HUD scene workflow:

  1. scene_create — root: CanvasLayer (layer = 10)
  2. Add Control (HUD, full rect anchor)
  3. Add TextureProgressBar (HealthBar) anchored top-left: offset_left=10, offset_top=10, offset_right=210, offset_bottom=30
  4. Add TextureProgressBar (ManaBar) below
  5. Add HBoxContainer (BuffContainer) below bars
  6. Add SubViewportContainer (Minimap) anchored top-right
  7. Add SubViewport → Camera2D inside minimap container
  8. scene_save

Inventory scene workflow:

  1. scene_create — root: CanvasLayer (layer = 20)
  2. PanelContainer centered (anchor_left=0.5, anchor_right=0.5, anchor_top=0.5, anchor_bottom=0.5)
  3. MarginContainer → VBoxContainer → Label + GridContainer (columns = 8)
  4. scene_save
CanvasLayer Ordering
LayerPurpose
10HUD (health, mana, buffs, minimap)
15Floating text (damage numbers, XP popups)
20Menus (inventory, dialog, pause, settings)
30Tooltips
100Scene transitions

Verification workflow: scene_create → editor_run → check editor_debug_output for layout warnings → editor_stop → adjust → repeat.

Anti-Patterns

#Anti-PatternProblemFix
1UI in game world spaceCamera movement moves the HUDPlace all UI on a CanvasLayer
2Hardcoded pixel positionsUI breaks at different resolutionsUse anchors and Container nodes
3Polling UI state every frameChecking player.health in _processUse signals — update only on change
4One massive UI sceneEditor lag, merge conflictsSplit into sub-scenes
5No input guard on menusPlayer moves while typing in chatPause tree or consume input events
6Theme per ControlInconsistent stylingOne shared Theme resource
7Direct node references in dialogTightly couples data and displayUse a dialog manager autoload + signals
8Drag-drop without previewNothing visible while draggingAlways set set_drag_preview()
9Tooltip with no viewport clampingClips off screen edgesClamp to viewport bounds before showing
10Missing state reset on menu closeStale hover/selection state on reopenReset in _on_visibility_changed
11Font fallback not configuredMissing chars render as boxesSet fallback fonts in Theme
12Damage numbers as children of entitiesDisappear when entity diesSpawn on dedicated CanvasLayer (layer 15)

Cross-References

SkillWhen to Load
gamedev-2d-platformerPlayer movement, combat, camera that the HUD wraps
gamedev-2d-art-pipelineSprite creation, UI icon workflows, texture atlas
gamedev-godotGodot engine fundamentals, scene architecture, MCP setup
gamedev-multiplayerNetcode for syncing UI state: health, inventory, trade

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dreamteam-hq/brigid/gamedev-2d-ui/badge)](https://verified-skill.com/skills/dreamteam-hq/brigid/gamedev-2d-ui)

Something wrong with this skill or its page? Tell us.