Class SpriteAtlas
Sprite atlas asset that contains collection of sprites combined into a single texture.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class SpriteAtlas : TextureBase
Constructors
SpriteAtlas()
Properties
Sprites
List with all tiles in the sprite atlas.
Declaration
[Unmanaged]
public Sprite[] Sprites { get; set; }
Property Value
Sprite[]
|
SpritesCount
Gets the sprites count.
Declaration
[Unmanaged]
public int SpritesCount { get; }
Property Value
System.Int32
|
Methods
AddSprite(Sprite)
Adds the sprite.
Declaration
[Unmanaged]
public SpriteHandle AddSprite(Sprite sprite)
Parameters
Sprite
sprite
The sprite. |
Returns
SpriteHandle
The sprite handle. |
FindSprite(String)
Finds the sprite by the name.
Declaration
[Unmanaged]
public SpriteHandle FindSprite(string name)
Parameters
System.String
name
The name. |
Returns
SpriteHandle
The sprite handle. |
GetSprite(Int32)
Gets the sprite data.
Declaration
[Unmanaged]
public Sprite GetSprite(int index)
Parameters
System.Int32
index
The index. |
Returns
Sprite
The sprite data. |
GetSpriteArea(Int32, out Rectangle)
Gets the sprite area.
Declaration
[Unmanaged]
public void GetSpriteArea(int index, out Rectangle result)
Parameters
System.Int32
index
The index. |
Rectangle
result
The output sprite area. |
RemoveSprite(Int32)
Removes the sprite.
Declaration
[Unmanaged]
public void RemoveSprite(int index)
Parameters
System.Int32
index
The sprite index. |
SaveSprites()
Save the sprites (texture content won't be modified).
Declaration
[Unmanaged]
public bool SaveSprites()
Returns
System.Boolean
True if cannot save, otherwise false. |
SetSprite(Int32, ref Sprite)
Sets the sprite data.
Declaration
[Unmanaged]
public void SetSprite(int index, ref Sprite value)
Parameters
System.Int32
index
The index. |
Sprite
value
The sprite data. |