Skip to main content

phaser-hud-component-patterns

Reusable patterns for implementing HUD elements in Phaser games, including positioning, styling, and test seam integration. Use when creating HUD components, timer displays, score counters, or health bars. Provides templates and patterns for consistent HUD implementation.

소스 정보

저장소
pmarashian/cursor-agent-skills
최근 소스 활동
2026년 2월 13일 19:51
감지된 SKILL.md 언어
영어
스타
2
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
phaser-hud-component-patterns
description
Reusable patterns for implementing HUD elements in Phaser games, including positioning, styling, and test seam integration. Use when creating HUD components, timer displays, score counters, or health bars. Provides templates and patterns for consistent HUD implementation.
# Phaser HUD Component Patterns ## Overview Reusable patterns for implementing HUD elements in Phaser games. Accelerate HUD implementation and ensure consistency. ## HUD Background Pattern - Use `Phaser.GameObjects.Graphics` for rounded rectangles - Set depth to 100+ to appear above game elements - Use semi-transparent backgrounds (alpha: 0.7-0.8) - Position relative to camera dimensions ## Text Element Pattern - Position text relative to HUD background - Set depth to 101+ (above background) - Use consistent font families and sizes - Update text in real-time via `setText()` ## Test Seam Integration - Expose HUD properties: colors, positions, text content - Include visual state accessors: `getTimerColor()`, `getCoinCount()` - Document HUD structure in test seam ## Common HUD Elements See `references/hud-elements.md` for patterns: - Timer display (MM:SS format) - Score/coin counter - Health bar (if applicable) - Minimap (if applicable) ## Test in Isolation Before or while integrating a HUD component into GameScene, create a standalone component test scene that only renders this HUD element (e.g. `HUDTimerTestScene`). Test layout, test seam, and behavior there. Use the **phaser-component-test-scenes** skill for workflow and template. ## Template See `assets/hud-template.ts` for HUD component template. ## Resources - `references/hud-elements.md` - Timer display, score counter, health bar patterns - `assets/hud-template.ts` - Template for HUD components - **phaser-component-test-scenes** - Standalone test scenes for UI components
GitHub에서 보기