Skip to main content

Sprite

The Sprite Component renders and animates Sprite Assets into the scene.

There are two types of sprite: Simple and Animated.

Simple Sprites

Simple Sprite Components display a single frame from an atlas.

Simple Sprite

Simple Sprite Component Properties

PropertyDescription
TypeSimple or Animated.
SpriteThe Sprite Asset to display.
FrameThe frame index of the Sprite to display.
WidthThe width of the sprite when using 9-slicing (only shown for sliced/tiled sprites).
HeightThe height of the sprite when using 9-slicing (only shown for sliced/tiled sprites).
ColorA color to apply as a tint to the sprite.
OpacityThe transparency of the sprite (0 to 1).
Flip XFlip the rendered sprite horizontally.
Flip YFlip the rendered sprite vertically.
Batch GroupThe Batch Group that this sprite belongs to. More on Batching here.
LayersThe Layers in which to render the sprite.
Draw OrderThe order in which this sprite is rendered. Lower numbers are rendered first.

Animated Sprites

Animated Sprite Components have multiple Sprite Animation Clips attached which can play back different Sprite Assets.

Animated Sprite

Animated Sprite Component Properties

PropertyDescription
TypeSimple or Animated.
ColorA color to apply as a tint to the sprite.
OpacityThe transparency of the sprite (0 to 1).
Flip XFlip the rendered sprite horizontally.
Flip YFlip the rendered sprite vertically.
SpeedMultiplier applied to the speed at which sprite animation clips on this sprite component are animated.
LayersThe Layers in which to render the sprite.
Draw OrderThe order in which this sprite is rendered. Lower numbers are rendered first.
Auto PlayThe name of a sprite animation clip to play when the sprite is enabled. Select from available clips or None.

Sprite Animation Clip Properties

PropertyDescription
NameThe name of the Sprite Animation Clip. Used to reference an individual clip.
LoopIf true the animation clip will loop back to the start when it reaches the end.
Frames Per SecondThe speed at which the clip is played in Frames Per Second.
SpriteThe Sprite Asset which is used to play this clip.

See Also

Scripting Interface

You can control a Sprite Component's properties using a Script Component. The Sprite Component's scripting interface is here.