sprite
2D: a picture (one frame of a sprite sheet), animated by named clips. Positions in a 2D scene are world units on X (right) and Y (up). Scripts: self.play("run"), self.flip = true.
In scene text
sprite { image "…" frame_width 1 frame_height 1 }Add it in the Inspector (Add Component), in scene text as above, or ask your AI. Fields you leave out keep their defaults.
Fields 26
| Field | Type | Unit / range | What it does |
|---|---|---|---|
image | text | — | The image in Assets ("Sprites/hero.png"; a sheet of equal frames left to right, top to bottom), or "builtin:white" / "builtin:soft". |
frame_width | number | px, 0 … 8192 | One frame's width in image pixels (0: the whole image). |
frame_height | number | px, 0 … 8192 | One frame's height in image pixels (0: the whole image). |
frame | number | 0 … 100000 | The frame shown while no clip plays (0 = first). |
clips | list of text | — | Animation clips "name=first-last@fps", optionally " once": ["idle=0-3@6", "run=4-9@14", "jump=10"]. |
clip | text | — | The clip playing from the start (empty: just `frame`). |
flip_x | true / false | — | Mirrored left to right (facing the other way). |
flip_y | true / false | — | Mirrored top to bottom. |
pivot | (x, y, z) | — | The point of the frame on the position, as shares of its size: (0.5, 0, 0) bottom middle (feet), (0.5, 0.5, 0) centre. |
layer | number | -1000 … 1000 | Drawing order: higher in front. Tilemaps usually sit at 0, the hero at 10. |
tint | colour (r, g, b) | — | Multiplies its colours (white keeps them). |
opacity | number | 0 … 1 | 0 invisible, 1 solid. |
pixels_per_unit | number | 0.01 … 100 | Image pixels per world unit (2: a 128 px frame is 64 units tall). |
screen | true / false | — | Fixed to the screen (HUD icons): position in camera units from the top left, y down. |
rim | number | 0 … 4 | Rim light on the edges facing the scene's light (camera_2d light): 0 none, 1 strong. Makes flat art read as round. |
rim_color | colour (r, g, b) | — | The rim light's colour. |
rim_width | number | units, 0 … 100 | How wide the rim light is. |
shading | number | 0 … 1 | Darkens the edges facing away from the light (form shadow). |
contact_shadow | number | units, 0 … 10000 | A soft shadow on the ground below, this wide (0 none); shrinks and fades as it rises. |
glow | number | 0 … 20 | A soft pulsing glow behind it, this many times its size (0 none): coins, gems, magic. |
glow_color | colour (r, g, b) | — | The glow's colour. |
sparkle | number | 0 … 60 | Twinkling glints on it, about this many a second (0 none). |
y_sort | true / false | — | Walk-behind depth: on the same layer, sprites draw by their feet (higher up the screen draws first, so the hero passes behind a tree above its base and in front below it). Ground tiles on the layer draw first. |
sort_offset | number | units, -100000 … 100000 | Moves the sort point (feet) up from the position: a tree's trunk base, a table's front edge. With sort_with: negative draws just behind that object. |
sort_with | text | — | |
roof | text | — |
Arcwright Beta 2 (0.4.0) · generated from the engine source (25e375c86)Something wrong or missing? Tell us