SpriteSheet
An animated pixel-art sprite from any sprite sheet, on any entity. Name the animations as rows of the sheet (`animations = "idle=0:6:8, run=1:8:14, jump=2:3:12:once"`) and switch with `anim`; `facing = -1` mirrors it. The entity's position is the picture's bottom-centre (the feet…
pixelSprites.SpriteSheet
An animated pixel-art sprite from any sprite sheet, on any entity. Name the animations as rows of the sheet (animations = "idle=0:6:8, run=1:8:14, jump=2:3:12:once") and switch with anim; facing = -1 mirrors it. The entity's position is the picture's bottom-centre (the feet). anim and facing sync, so every player sees the same animation; each peer draws the picture on a temporary child. Needs no sibling components; the sheet is a material on the pixelSprites.sprite shader.
Methods: play(name, restart?), isFinished() (for :once animations). Fields and an example are in the package README.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2pixelSprites.SpriteSheet: an animated pixel-art sprite from any sprite sheet, on any entity, with no other kit. Name your animations once as rows of the sheet, then switch with one field: local e = entity.spawn("Hero", { position = { 0, 1, 0 } }) e.component.add("pixelSprites.SpriteSheet", { sheet = asset.resolve("my.art.hero", "material"), -- a material on the pixelSprites.sprite shader -- or: texture = asset.resolve("my.art.hero", "texture"), and pixelSprites builds the material frameWidth = 32, frameHeight = 32, columns = 8, rows = 8, animations = "idle=0:6:8, run=1:8:14, jump=2:3:12:once", }) e.component.get("pixelSprites.SpriteSheet").anim = "run" `animations` lists name=row:frames:fps, with `:once` for an animation that holds its last frame. `anim` and `facing` sync, so every player sees the same animation; each peer draws the picture itself. The picture's pivot is the bottom-centre of the frame (the entity's position is the feet), it mirrors with `facing`, and it stays on the art's pixel grid.
parse(spec: string) → void
"idle=0:6:8, run=1:8:14, jump=2:3:12:once" -> { idle = { row, frames, fps, loop } }
| arg | type | description |
|---|---|---|
| spec | string |
build( ) → void
tick(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onDestroy( ) → void
isFinished( ) → boolean
Has a `:once` animation reached its last frame?
play(name: string, restart: boolean?) → void
Play an animation; with `restart`, replay it from its first frame even if it is playing.
| arg | type | description |
|---|---|---|
| name | string | |
| restart | boolean? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.