recrownedathenaeum/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs

43 lines
1.1 KiB
C#
Raw Normal View History

using Microsoft.Xna.Framework;
using RecrownedAthenaeum.Pipeline.NinePatch;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
public class TextureAtlasData
{
public TextureAtlasRegion[] regions;
public string textureName;
public TextureAtlasData(string textureName, TextureAtlasRegion[] regions)
{
this.regions = regions;
this.textureName = textureName;
}
public class TextureAtlasRegion
{
public string name;
public Rectangle location;
public NinePatchData ninePatchData;
public void SetPosition(int x, int y)
{
location.X = x;
location.Y = y;
}
public void SetSize(int width, int height)
{
location.Width = width;
location.Height = height;
}
public void SetBounds(int x, int y, int width, int height)
{
SetPosition(x, y);
SetSize(width, height);
}
}
}
}