Class SpriteAtlas
Sprite atlas asset that contains collection of sprites combined into a single texture.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Render2D/SpriteAtlas.h
Syntax
public class SpriteAtlas : public TextureBase
Fields
Sprites
List with all tiles in the sprite atlas.
Declaration
public Array<Sprite> Sprites
Field Value
Array<Sprite>
|
Methods
AddSprite(const Sprite& sprite)
Adds the sprite.
Declaration
public SpriteHandle AddSprite(const Sprite& sprite)
Parameters
Sprite
sprite
The sprite. |
Returns
SpriteHandle
The sprite handle. |
FindSprite(const StringView& name)
Finds the sprite by the name.
Declaration
public SpriteHandle FindSprite(const StringView& name) const
Parameters
StringView
name
The name. |
Returns
SpriteHandle
The sprite handle. |
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
GetSprite(int32 index)
Gets the sprite data.
Declaration
public Sprite GetSprite(int32 index) const
Parameters
int32
index
The index. |
Returns
Sprite
The sprite data. |
GetSpriteArea(int32 index, Rectangle& result)
Gets the sprite area.
Declaration
public void GetSpriteArea(int32 index, Rectangle& result) const
Parameters
int32
index
The index. |
Rectangle
result
The output sprite area. |
GetSpritesCount()
Gets the sprites count.
Declaration
public int32 GetSpritesCount() const
Returns
int32
|
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
LoadSprites(ReadStream& stream)
Declaration
protected bool LoadSprites(ReadStream& stream)
Parameters
ReadStream
stream
|
Returns
bool
|
RemoveSprite(int32 index)
Removes the sprite.
Declaration
public void RemoveSprite(int32 index)
Parameters
int32
index
The sprite index. |
SaveSprites()
Save the sprites (texture content won't be modified).
Declaration
public bool SaveSprites()
Returns
bool
True if cannot save, otherwise false. |
SetSprite(int32 index, const Sprite& value)
Sets the sprite data.
Declaration
public void SetSprite(int32 index, const Sprite& value)
Parameters
int32
index
The index. |
Sprite
value
The sprite data. |
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |