Sprite
Draws an image (or a solid rectangle when no image is set) at the entity’s transform.
Works with: Animation (to play frames of a sprite sheet)
Needed by: Animation, Billboard, Character, Trail
Draws itself (its entity draws at Order 0 unless it has a Sprite, whose order counts).
In a network game, it also sends values of its own besides its properties.
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
image: text = null. Image path relative to the project’s Assets folder, e.g. “Sprites/player.png”. (A picture in Assets, e.g. “Sprites/back.png”.) (Field: an image.)tint: a color, “#RRGGBB” or “#RRGGBBAA” = “#FFFFFFFF”. Multiplies the image’s colors: white leaves it as it is, and a lower alpha fades it. (Field: a color.)size: [x, y] = [1,1]. Size in world units before the transform’s scale. (Field: a vector.)flipX: true or false = false. Draws the image mirrored left to right (movement components flip it to face the way they go). (Field: on or off.)flipY: true or false = false. Draws the image upside down. (Field: on or off.)order: a whole number = 0. Higher draws on top. Ties are broken by Z position, then hierarchy order. (Field: a number.)
Sprite Sheet
Section titled “Sprite Sheet”columns: a whole number = 1. For sprite sheets: frames across the image. 1 for a single image. (Field: a number.)rows: a whole number = 1. For sprite sheets: frames down the image. (Field: a number.)frame: a whole number = 0. Which frame to show, counting left to right, top to bottom from 0. (Field: a number.)
Stretching
Section titled “Stretching”slice: a number = 0. For panels and buttons that stretch (nine-slice): how much of the image, from 0 to 0.5 of its width and height, is border at each edge. Corners then keep their shape at any Size, edges stretch one way and the middle fills the rest. 0 stretches the whole image. (Field: a number.)sliceSize: a number = 0.25. With Slice: how big the border is drawn, in world units (never more than half the sprite). (Only used when slice is set.) (Field: a number.)
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
frameRect: [x, y, z, w]. The part of the image to show for Frame: (u, v, width, height) in 0–1 image space.flashOverlay: a color, “#RRGGBB” or “#RRGGBBAA”. The color painted over the sprite right now by Flash, with its alpha saying how much (0 none, 1 all of it). The image’s shape and transparency are kept.isBlinkedOut: true or false. True while Blink has the sprite in its hidden half.
Scripts use it as Sprite: its methods, events and values that aren’t saved with the scene.