text-and-bitmaptext

Featured

Use this skill when displaying text in Phaser 4. Covers Text game objects, BitmapText, web fonts, text styling, word wrap, alignment, padding, and dynamic text content. Triggers on: Text, BitmapText, this.add.text, font, word wrap, text style.

AI & Automation 957 stars 79 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
99
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Text and BitmapText > Displaying text in Phaser 4 -- the Canvas-based Text game object, TextStyle configuration, word wrap, BitmapText (static and dynamic), retro fonts, text alignment, text bounds, and padding. **Key source paths:** `src/gameobjects/text/`, `src/gameobjects/bitmaptext/static/`, `src/gameobjects/bitmaptext/dynamic/` **Related skills:** ../loading-assets/SKILL.md, ../sprites-and-images/SKILL.md, ../game-object-components/SKILL.md ## Quick Start ```js // Canvas-based Text (flexible styling, uses browser fonts) const title = this.add.text(400, 50, 'Hello World', { fontFamily: 'Arial', fontSize: '32px', color: '#ffffff' }); // BitmapText (pre-rendered font texture, faster rendering) // Font must be loaded first: this.load.bitmapFont('myFont', 'font.png', 'font.xml') const score = this.add.bitmapText(400, 100, 'myFont', 'Score: 0', 32); // DynamicBitmapText (per-character manipulation via callback) const fancy = this.add.dynamicBitmapText(400, 200, 'myFont', 'Wavy!', 32); fancy.setDisplayCallback(function (data) { data.y += Math.sin(data.index * 0.5 + fancy.scene.time.now * 0.005) * 10; return data; }); ``` ## Core Concepts ### Text vs BitmapText | Feature | Text | BitmapText | DynamicBitmapText | |---|---|---|---| | Rendering method | Canvas 2D API, uploaded as texture | Pre-rendered font texture | Pre-rendered font texture | | Web/CSS fonts | Yes | No | No | | Shadows, gradients, strokes | Yes (Canvas API) | Drop shadow only (WebGL)...

Details

Author
autonomous-ai
Repository
autonomous-ai/openharness
Created
1 months ago
Last Updated
today
Language
C
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category