Skip to main content

Interface: SpriteEcsComponent

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

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

Extends​

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.

Inherited from​

SpriteDefaultedOptions.enabled


height​

height: number

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

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

Inherited from​

SpriteDefaultedOptions.layer


opacityMultiplier?​

optional opacityMultiplier?: number

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

An additional multiplier applied to tintColor.a when computing this sprite's final rendered alpha, on top of (not instead of) the tint's own alpha. Left undefined, this sprite renders at tintColor.a alone - a genuinely optional field, not one with a 1 default, kept separate from tintColor.a so a system can apply an environment-wide fade (e.g. @forge-game-engine/forge/ui's CanvasGroupEcsComponent, via createUiCanvasGroupEcsSystem) without overwriting - and later needing to restore - whatever alpha the caller authored on tintColor itself.


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.

Inherited from​

SpriteDefaultedOptions.pivot


renderable​

renderable: Renderable

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

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

Inherited from​

SpriteDefaultedOptions.slices


sortDepth?​

optional sortDepth?: number

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

Overrides the depth this sprite is sorted by within its layer, in place of the default (position.world.y). Lower values draw first (further back). Left undefined, sprites sort by world Y as before - this is a genuinely optional field, not one with a 0 default, since 0 would silently override world-Y sorting for every 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.

Inherited from​

SpriteDefaultedOptions.tintColor


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.

Inherited from​

SpriteDefaultedOptions.uvOffset


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.

Inherited from​

SpriteDefaultedOptions.uvScale


width​

width: number

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

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