Skip to main content

Interface: SpriteDefaultedOptions

Defined in: rendering/components/sprite-component.ts:39

Fields of SpriteEcsComponent with a sensible default; callers may omit these.

Extended by​

Properties​

enabled​

enabled: boolean

Defined in: rendering/components/sprite-component.ts:78

Whether this sprite is drawn. When false, the render system skips this entity entirely for every camera, before any culling-mask check.


layer​

layer: number

Defined in: rendering/components/sprite-component.ts:86

The draw-order layer for this sprite, relative to other sprites drawn by the same camera: lower layers are drawn first, so higher layers appear on top. Sprites in the same layer are then ordered by depth (world Y position).


pivot​

pivot: Vector2

Defined in: rendering/components/sprite-component.ts:48

The sprite's origin, normalized to the sprite's own size: (0, 0) is the bottom-left corner, (0.5, 0.5) (the default) is the center, and (1, 1) is the top-right corner - Y-up, matching every other Y-facing value in the engine (world position, rotation). Determines which point of the sprite is placed at, and rotated/scaled around, the entity's position.


slices?​

optional slices?: NineSliceOptions

Defined in: rendering/components/sprite-component.ts:95

Nine-slice ("9-patch") configuration. When set, the render system draws this sprite as up to nine regions (four fixed-size corners, four stretched/tiled edges, and a stretched/tiled center) instead of a single stretched quad, so corner artwork keeps its size as width/height change. Omit for a normal, single-quad sprite.


tintColor​

tintColor: Color

Defined in: rendering/components/sprite-component.ts:55

A color multiplied against the sprite's sampled texture color (RGB only; the texture's own alpha is used unmodified) to tint it. Defaults to Color.white, which leaves the texture unmodified.


uvOffset​

uvOffset: Vector2

Defined in: rendering/components/sprite-component.ts:64

The top-left corner of the region of the texture to sample, as a normalized (0 to 1) fraction of the texture's full size. Used with uvScale to select a single frame from a texture atlas/sprite sheet; updated automatically by the sprite animation system when the sprite has a SpriteAnimationEcsComponent.


uvScale​

uvScale: Vector2

Defined in: rendering/components/sprite-component.ts:72

The size of the region of the texture to sample, as a normalized (0 to

  1. fraction of the texture's full width/height. Defaults to (1, 1) (the whole texture). Used with uvOffset to select a single frame from a texture atlas/sprite sheet.