Basic Sprite
SpriteGroup
The SpriteGroup class manages 2D sprite rendering. All sprites must be added to a SpriteGroup instance:
const spriteGroup = new SpriteGroup();scene.add(spriteGroup);spriteGroup.add(sprite);Sprite2D
The Sprite2D class represents a 2D sprite. It requires a texture and supports optional properties like anchor point and size:
const sprite = new Sprite2D({ texture: myTexture, anchor: [0.5, 0.5], // Center anchor});Next Steps
- Animation - Add spritesheet animation
- Batch Demo - Render thousands of sprites