Class: SpriteFrame
Typed wrapper for a loaded texture. texture is unknown to stay backend-agnostic — cast to your backend's type when you need its API (e.g. as Pixi.Texture). getSize() returns the cropped frame size for atlas frames, not the source image.
Extends
Constructors
Constructor
ts
new SpriteFrame(assetId, loader?): SpriteFrame;Parameters
| Parameter | Type |
|---|---|
assetId | string |
loader? | IAssetLoader |
Returns
SpriteFrame
Inherited from
Properties
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
assetId | readonly | string | AssetHandle.assetId |
Accessors
texture
Get Signature
ts
get texture(): unknown;Returns
unknown
Methods
GetDefaultAssetLoader()
ts
static GetDefaultAssetLoader(): IAssetLoader | null;Returns
IAssetLoader | null
Inherited from
AssetHandle.GetDefaultAssetLoader
getSize()
ts
getSize():
| {
height: number;
width: number;
}
| null;Returns
| { height: number; width: number; } | null
isLoaded()
ts
isLoaded(): boolean;Returns
boolean
Inherited from
SetDefaultAssetLoader()
ts
static SetDefaultAssetLoader(loader): void;Parameters
| Parameter | Type |
|---|---|
loader | IAssetLoader | null |
Returns
void