recrownedathenaeum/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs

44 lines
1.1 KiB
C#
Raw Normal View History

using Microsoft.Xna.Framework;
using Newtonsoft.Json;
using RecrownedAthenaeum.Pipeline.NinePatch;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
public class TextureAtlasData
{
public TextureAtlasRegion[] regions;
public string 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);
}
}
}
}