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
{
2019-01-15 05:38:50 +00:00
public AtlasRegionData[] regions;
public string textureName;
2019-01-15 05:38:50 +00:00
public TextureAtlasData(string textureName, AtlasRegionData[] regions)
{
this.regions = regions;
this.textureName = textureName;
}
2019-01-15 05:38:50 +00:00
public class AtlasRegionData
{
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);
}
}
}
}