Talos docs

SpriteView

Since 0.6
Plain text

Fields

FieldTypeRequiredDefaultAllowed valuesDescription
imagestringyesA key of scene.assets whose kind is "texture": the picture (a PNG with alpha). The whole image, unless rect picks part of a sheet.
rectunknown[]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.
gridunknown[]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).
cellnumbernoWhich 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).
pivotVec2no[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).
mirrorbooleannofalseDraw 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.

See also