2d

Builds 2D sprite rendering, tilemaps, and animation in ignifx games using @ignifx/2d.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/astrum-forge/ignifx --skill 2d-astrum-forge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 2d
Source: https://github.com/astrum-forge/ignifx/tree/main/packages/2d/skills/2d
Command: npx skills add https://github.com/astrum-forge/ignifx --skill 2d-astrum-forge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @ignifx/2d, @ignifx/core.

What problem does it solve? Building 2D games in ignifx requires correctly wiring sprites, texture atlases, tilemaps, sorting layers, and pixel-perfect cameras on top of the engine's 3D-oriented entity system, and this Skill provides the operational knowledge to do it without trial and error. ## Core Features & Use Cases - Sprite Rendering & Animation: Configure SpriteRenderer, SpriteAnimator, texture atlases (.atlas.json), and animation clips (.spriteanim.json) with sorting layers and Y-sort. - Tilemaps & Import: Render Tilemap components, import Tiled and LDtk maps, and spawn entities from object layers via registerTileObjectFactory. - Cameras, Picking & Batches: Set up Camera2D with pixel-perfect or follow behavior, pick sprites with pickAt, and draw thousands of entity-less sprites with SpriteBatch. - Use Case: You are building a 2D top-down game and need a pixel-perfect camera following a hero sprite, a Tiled-imported level with collision, and an additive spark particle batch. ## Quick Start Ask the AI to create an ignifx 2D scene with a Camera2D, an animated sprite loaded from a texture atlas, and a tilemap rendered from a Tiled map file.

Frequently Asked Questions about 2d

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render an animated sprite in ignifx?

Load a .atlas.json and .spriteanim.json through app.assets, add a SpriteRenderer with the atlas to an entity, then add a SpriteAnimator with the clips and call play with the clip name. Await the asset handles before app.start so frames are ready.

How do I import a Tiled or LDtk tilemap into ignifx?

Use the importTiledMap or importLdtkLevel functions, which are pure functions callable without an app. Attach the resulting TilemapAsset to a Tilemap component and pair it with a TilemapRenderer referencing the tileset atlas.

Does @ignifx/2d work in headless mode without a GPU?

Yes, the toolkit works under createApp with headless set to true: components keep state, loaders parse, and SpriteAnimator advances on the stepped clock. Only actual pixel output requires a WebGPU-capable browser or Electron.

Why is my 2D sprite tiny or huge in ignifx?

The default pixelsPerUnit is 100, so a 32-pixel sprite is only 0.32 world metres wide. Set pixelsPerUnit to your art's pixel size, such as 16 or 32, in the twoD extension options for pixel art.

When should I use SpriteBatch instead of SpriteRenderer?

Use SpriteBatch for large crowds of entity-less sprites like bullets, sparks, or particles where per-entity cost exceeds drawing cost. Use SpriteRenderer for anything needing a transform, picking, or a place in a scene file.

Why does orderInLayer not change my sprite draw order?

orderInLayer only reorders sprites inside a Y-sorted sorting layer. Without ySort enabled for that layer, sprites draw by insertion order, so enable Y-sort or use separate sorting layers.