Skip to content

Components

Sprite

Draws a texture on this node, tinted, sized and anchored as set here. The most common way anything in a scene becomes visible.

On this page

Add it

+ Add node → Sprite, Animated Sprite, Parallax, Shader Material, Root Motion Character creates a node with it already on. Already have a node for it? Add component → SpriteComponent.

From a script

A script on the same node writes these fields by name. SpriteComponent is the name to pass.

rgs
set_point("SpriteComponent", "size", vec2(1.0, 1.0));
set_point("SpriteComponent", "anchor", vec2(0.5, 0.5));
set_colour("SpriteComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_number("SpriteComponent", "flash", 0.0);
set_flag("SpriteComponent", "opaque", false);
set_flag("SpriteComponent", "unshaded", false);
set_flag("SpriteComponent", "light_only", false);
set_number("SpriteComponent", "specular", 0.0);
set_number("SpriteComponent", "slice_border", 0.0);
set_point("SpriteComponent", "tile", vec2(0.0, 0.0));
set_text("SpriteComponent", "region_name", "");

Fields

FieldScript nameKindDefaultWhat it does
TexturetextureassetnoneThe picture or sprite sheet this sprite draws.
Sizesizetwo numbers (x, y)(1, 1)Size in local units before the node transform is applied.
Anchoranchortwo numbers (x, y), 0 to 1, step 0.01(0.5, 0.5)Anchor point on the sprite: 0, 0 is the top-left corner, 0.5, 0.5 is the centre.
Colorcolorcolour#ffffffTints the art; alpha fades it out.
Flashflashnumber, 0 to 1, step 0.050Washes the picture toward white and keeps its shape: 1 is a white silhouette, for a hit.
Sort Layerlayernumber0Lower draws first.
Flipflipsection—Mirroring.
FieldScript nameKindDefaultWhat it does
XxcheckboxoffMirror left to right.
YycheckboxoffMirror top to bottom.
OpaqueopaquecheckboxoffDraw without blending — for the backmost layer.
Blendblendone of Alpha, Add, Multiply, Screen, SubtractAlphaAdditive for glows and explosions, multiply for shadows.
UnshadedunshadedcheckboxoffIgnore lighting: always draw at full brightness.
Light Onlylight_onlycheckboxoffDraw only where light falls.
Normal Mapnormal_mapassetnoneAdds surface detail to how light falls on this sprite.
Specularspecularnumber, 0 to 1, step 0.050How brightly this surface catches a highlight, from none to full.
Draw mode
Draw Modedraw_modeone of Simple, Sliced, TiledSimpleNine-slice for a panel that stretches, tiled for a fence or a chain.
Slice Borderslice_bordernumber, at least 0, step 0.50How many pixels of each corner keep their size while the middle stretches.
Tile Sizetiletwo numbers (x, y), at least 0(0, 0)How far apart the repeats sit.
Atlas Regionregion_nametextemptyNamed area within the sheet; empty draws the whole picture.
MaskmasksectionnoneDraw only inside (or outside) a mask channel.
FieldScript nameKindDefaultWhat it does
Channelchannelnumber, 0 to 7noneWhich mask channel this sprite obeys.
InsideinsidecheckboxnoneDraw inside the mask rather than outside it.