SpriteView
Since 0.6Changed in next
Fields
| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
image | string | yes | A key of scene.assets whose kind is "texture": the picture (a PNG with alpha). The whole image, unless rect picks part of a sheet. | ||
rect | unknown[] | no | [x, y, width, height] in pixels from the image's top-left corner: the part of a sheet this picture is. Absent: the whole image. Inside the image, width and height above zero. | ||
normalImage | string | no | With lit, a key of scene.assets whose kind is "texture": a tangent-space normal map the size of image, cut the same way (rect, or grid and cell). Absent: the picture is flat, facing out of its plane. | ||
emissiveImage | string | no | With lit, a key of scene.assets whose kind is "texture": a mask the size of image, cut the same way. Its brightness times its alpha scales the sprite's emissive (white when absent). Absent: emissive glows over the whole picture. | ||
grid | unknown[] | no | [columns, rows], whole numbers above zero: the image is a sheet of equal cells, each floor(width / columns) by floor(height / rows) pixels, and cell picks one. Instead of rect, not with it (sprite-invalid). | ||
cell | number | no | Which cell of grid this picture is, counting from 0 along the top row, left to right, then the next row down. A whole number below columns × rows; needs grid, and grid needs it (sprite-invalid). | ||
pivot | Vec2 | no | [x, y] in pixels from the picture's top-left corner (the rect's, with one): the pixel that sits on the entity's origin. Absent: the sprite's anchor. May lie outside the picture (a flying thing drawn above its origin). | ||
mirror | boolean | no | false | Draw the picture flipped left to right about its pivot, so one picture serves both sides (view 1 of 8, mirrored, is view 7). Default false. |