Added setup system. Changed reader and writer for texture atlas and nine patch to have image and serialized data be in same file. Some refactors occurred as well.
This commit is contained in:
@@ -28,10 +28,11 @@ namespace RecrownedAthenaeum.SpecialTypes
|
||||
/// <param name="right">Right side.</param>
|
||||
/// <param name="bottom">Bottom side.</param>
|
||||
/// <param name="top">Top side.</param>
|
||||
public NinePatch(Texture2D texture, int left, int right, int bottom, int top)
|
||||
/// <param name="textureBounds">The dimensions and potentially the coordinates of the rectangle on an atlas. If left to default of null, will only be set to texture bounds.</param>
|
||||
public NinePatch(Texture2D texture, int left, int right, int bottom, int top, Rectangle? textureBounds = null)
|
||||
{
|
||||
this.texture = texture;
|
||||
textureRegion = texture.Bounds;
|
||||
if (textureBounds.HasValue) textureRegion = textureBounds.Value; else textureRegion = texture.Bounds;
|
||||
if (left + right >= textureRegion.Width) throw new ArgumentOutOfRangeException("a and b cannot be greater than or equal to the width of region.");
|
||||
if (bottom + top >= textureRegion.Height) throw new ArgumentOutOfRangeException("c and d cannot be greater or equal to the height of the texture.");
|
||||
this.left = left;
|
||||
|
||||
Reference in New Issue
Block a user