Interface: SpriteDefaultedOptions
Defined in: rendering/components/sprite-component.ts:37
Fields of SpriteEcsComponent with a sensible default; callers may omit these.
Extended by
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.
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).
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.
slices?
optionalslices?: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.
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.
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.
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
- fraction of the texture's full width/height. Defaults to
(1, 1)(the whole texture). Used withuvOffsetto select a single frame from a texture atlas/sprite sheet.