@@ -40,6 +40,23 @@ SpriteAtlas::SpriteAtlas(const SpawnParams& params, const AssetInfo* info)
|
||||
{
|
||||
}
|
||||
|
||||
int32 SpriteAtlas::GetSpritesCount() const
|
||||
{
|
||||
return Sprites.Count();
|
||||
}
|
||||
|
||||
Sprite SpriteAtlas::GetSprite(int32 index) const
|
||||
{
|
||||
CHECK_RETURN(index >= 0 && index < Sprites.Count(), Sprite())
|
||||
return Sprites.Get()[index];
|
||||
}
|
||||
|
||||
void SpriteAtlas::SetSprite(int32 index, const Sprite& value)
|
||||
{
|
||||
CHECK(index >= 0 && index < Sprites.Count());
|
||||
Sprites[index] = value;
|
||||
}
|
||||
|
||||
SpriteHandle SpriteAtlas::FindSprite(const StringView& name) const
|
||||
{
|
||||
SpriteHandle result(const_cast<SpriteAtlas*>(this), -1);
|
||||
|
||||
@@ -111,32 +111,21 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the sprites count.
|
||||
/// </summary>
|
||||
/// <returns>The sprites count.</returns>
|
||||
API_PROPERTY() int32 GetSpritesCount() const
|
||||
{
|
||||
return Sprites.Count();
|
||||
}
|
||||
API_PROPERTY() int32 GetSpritesCount() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sprite data.
|
||||
/// </summary>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <returns>The sprite data.</returns>
|
||||
API_FUNCTION() Sprite GetSprite(const int32 index) const
|
||||
{
|
||||
return Sprites[index];
|
||||
}
|
||||
API_FUNCTION() Sprite GetSprite(int32 index) const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sprite data.
|
||||
/// </summary>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <param name="value">The sprite data.</param>
|
||||
/// <returns>The sprite handle.</returns>
|
||||
API_FUNCTION() void SetSprite(const int32 index, API_PARAM(Ref) const Sprite& value)
|
||||
{
|
||||
Sprites[index] = value;
|
||||
}
|
||||
API_FUNCTION() void SetSprite(int32 index, API_PARAM(Ref) const Sprite& value);
|
||||
|
||||
/// <summary>
|
||||
/// Finds the sprite by the name.
|
||||
|
||||
Reference in New Issue
Block a user