FlxAtlas
A loaded texture atlas with named frame lookup and ordered pickers.
Obtain instances via FlxG.atlas.load(...) / FlxG.atlas.get(...).
export declare class FlxAtlasProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
frameCount | readonly | number | Number of named frames in this atlas. |
key | readonly | string | - |
texture | readonly | Texture | Shared base texture (the full atlas sheet). |
Methods
framesByNumber()
framesByNumber(start: number, end: number): FlxAtlasFrameListReturn frames by 0-based index range (inclusive) or explicit index array.
Parameters:
| Parameter | Type | Description |
|---|---|---|
start | number | - |
end | number | - |
Returns: FlxAtlasFrameList
framesByNumber()
framesByNumber(indices: readonly number[]): FlxAtlasFrameListParameters:
| Parameter | Type | Description |
|---|---|---|
indices | readonly number[] | - |
Returns: FlxAtlasFrameList
framesByPrefix()
framesByPrefix(prefix: string, start: number, end: number, options?: FlxAtlasPrefixOptions): FlxAtlasFrameListReturn an ordered list of frames whose names match prefix + paddedNumber for each integer in [start, end] inclusive.
options.padding defaults to 1 (no leading zeros) and must be at least 1. Also retries each lookup with a .png suffix (Kenney convention).
Parameters:
| Parameter | Type | Description |
|---|---|---|
prefix | string | - |
start | number | - |
end | number | - |
options | FlxAtlasPrefixOptions | - |
Returns: FlxAtlasFrameList
getFrame()
getFrame(name: string): FlxAtlasFrameReturn the frame with the given exact name, or retry with .png appended (Kenney convention). Throws if neither resolves.
Parameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
Returns: FlxAtlasFrame
makeGraphic()
makeGraphic(frames: readonly (FlxAtlasFrame | null)[], frameWidth?: number, frameHeight?: number): TextureBuild a Flixel Texture strip for loadGraphic / tilemaps. Pass null for a fully transparent cell (e.g. tilemap air = index 0). Optional frameWidth / frameHeight scale cells while copying.
Parameters:
| Parameter | Type | Description |
|---|---|---|
frames | readonly (FlxAtlasFrame | null)[] | - |
frameWidth | number | - |
frameHeight | number | - |
Returns: Texture