From cf964cfe76fcf6f255cfd5a6d6c5639a6a6cb86b Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Fri, 7 Dec 2018 17:58:59 -0600 Subject: [PATCH] improved field modification functions added to texture atlas data and ninepatch data classes. --- .../NinePatch/NinePatchData.cs | 12 ++++++++++-- .../TextureAtlas/TextureAtlasData.cs | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs index c64ac92..9fa9806 100644 --- a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs +++ b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs @@ -8,8 +8,16 @@ namespace RecrownedAthenaeum.Pipeline.NinePatch { public class NinePatchData { - public string name; - public string bounds; + public string textureName; public int a, b, c, d; + + public NinePatchData(string textureName, int a, int b, int c, int d) + { + this.textureName = textureName; + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } } } diff --git a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs index 447ec23..460b733 100644 --- a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs +++ b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs @@ -20,6 +20,24 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas 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); + } } } }