Skip to main content

Sprites

· One min read
Balaur

A sprite is a textured 2D quad on a node: a texture, a size in pixels per unit, and the sheet or atlas cell it draws.

What landed

  • The component. texture and pixels_per_unit size the quad from the image; half_extents overrides the size in world units.
  • Flipbooks. columns and rows cut a sheet into a grid, and frame picks a cell, left to right then top to bottom — so an animation clip keys frame like any other property.
  • Atlas cells. region_origin and region_size, in texture pixels, draw one rectangle of a larger image and size the quad from it.
  • The rest. flip_x, flip_y, a color tint, and a material for a sprite that wants a shader of its own.
[[nodes]]
name = "Hero"

[nodes.sprite]
texture = "art/hero.png"
pixels_per_unit = 32
columns = 8
rows = 1
frame = 0

Sprites draw in z order with the other 2D shapes, and a 2D light map lights them without a material. The component reference lists every key.