2018-12-05 01:19:31 +00:00
|
|
|
|
using Microsoft.Xna.Framework;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using RecrownedAthenaeum.Pipeline.NinePatch;
|
2018-12-05 01:19:31 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|
|
|
|
{
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public class TextureAtlasData
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
|
|
|
|
public TextureAtlasRegion[] regions;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public string textureName;
|
2018-12-05 01:19:31 +00:00
|
|
|
|
|
2018-12-08 23:04:33 +00:00
|
|
|
|
public TextureAtlasData(string textureName, TextureAtlasRegion[] regions)
|
|
|
|
|
{
|
|
|
|
|
this.regions = regions;
|
|
|
|
|
this.textureName = textureName;
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-05 01:19:31 +00:00
|
|
|
|
public class TextureAtlasRegion
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|