Skip to content

Class: SpriteComponent ​

assetId is the canonical storage; spriteFrame is a cached SpriteFrame wrapper for the same id with getSize()/texture accessors. Setting either keeps both in sync.

Extends ​

Constructors ​

Constructor ​

ts
new SpriteComponent(
   assetId?, 
   tint?, 
   sizeMode?
): SpriteComponent;

Parameters ​

ParameterTypeDefault value
assetId| string | SpriteFrame""
tintnumber0xFFFFFF
sizeModeSpriteSizeModeSpriteSizeMode.Raw

Returns ​

SpriteComponent

Overrides ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited from
assetIdpublicstringundefined--
dirtypublicbooleantrue-Component.dirty
enabledpublicbooleantrue-Component.enabled
fillRangepublicnumberundefined--
fillStartpublicnumberundefined--
fillTypepublicSpriteFillTypeundefinedFill (Cocos-style FILLED). fillType None = normal sprite; Horizontal/Vertical crop the texture to a [start, start+range] band along that axis. start/range are 0..1 fractions.-
materialpublicstringundefinedMaterial slot (MaterialFields.ts).-
materialValuespublicRecord<string, unknown>undefined--
sizeModepublicSpriteSizeModeundefined--
tintpublicnumberundefined--

Accessors ​

spriteFrame ​

Get Signature ​

ts
get spriteFrame(): SpriteFrame;
Returns ​

SpriteFrame

Set Signature ​

ts
set spriteFrame(frame): void;
Parameters ​
ParameterType
frameSpriteFrame
Returns ​

void

© 2026 PlayAdGentic