Skip to main content

Interface: SpriteEcsComponent

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

Fields of SpriteEcsComponent with no sensible default; callers must always provide these.

Extends

Properties

enabled

enabled: boolean

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

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

Inherited from

SpriteDefaultedOptions.enabled


height

height: number

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

The sprite's height in world units. Scales the unit quad vertically before it's rotated and translated to the entity's world position.

Inherited from

SpriteRequiredOptions.height


layer

layer: number

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

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).

Inherited from

SpriteDefaultedOptions.layer


pivot

pivot: Vector2

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

The sprite's origin, normalized to the sprite's own size: (0, 0) is the top-left corner, (0.5, 0.5) (the default) is the center, and (1, 1) is the bottom-right corner. Determines which point of the sprite is placed at, and rotated/scaled around, the entity's position.

Inherited from

SpriteDefaultedOptions.pivot


renderable

renderable: Renderable

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

The geometry, material, and instancing configuration used to draw this sprite. Sprites sharing the same Renderable are batched into a single instanced draw call, and renderable.category is matched against each camera's culling mask to decide whether the camera draws this sprite at all.

Inherited from

SpriteRequiredOptions.renderable


slices?

optional slices?: NineSliceOptions

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

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.

Inherited from

SpriteDefaultedOptions.slices


tintColor

tintColor: Color

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

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.

Inherited from

SpriteDefaultedOptions.tintColor


uvOffset

uvOffset: Vector2

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

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.

Inherited from

SpriteDefaultedOptions.uvOffset


uvScale

uvScale: Vector2

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

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.

Inherited from

SpriteDefaultedOptions.uvScale


width

width: number

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

The sprite's width in world units. Scales the unit quad horizontally before it's rotated and translated to the entity's world position.

Inherited from

SpriteRequiredOptions.width