2018-12-05 01:19:31 +00:00
|
|
|
|
using Microsoft.Xna.Framework;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
using RecrownedAthenaeum.Pipeline.NinePatch;
|
2018-12-05 01:19:31 +00:00
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|
|
|
|
{
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public class TextureAtlasData
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
2019-01-15 05:38:50 +00:00
|
|
|
|
public AtlasRegionData[] regions;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public string textureName;
|
2018-12-05 01:19:31 +00:00
|
|
|
|
|
2019-01-15 05:38:50 +00:00
|
|
|
|
public TextureAtlasData(string textureName, AtlasRegionData[] regions)
|
2018-12-08 23:04:33 +00:00
|
|
|
|
{
|
|
|
|
|
this.regions = regions;
|
|
|
|
|
this.textureName = textureName;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-15 05:38:50 +00:00
|
|
|
|
public class AtlasRegionData
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
|
|
|
|
public string name;
|
|
|
|
|
public Rectangle location;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public NinePatchData ninePatchData;
|
2018-12-07 23:58:59 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2018-12-05 01:19:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|