Changed 9p and tatlas' to use a separately loaded texture.
This commit is contained in:
@@ -133,6 +133,7 @@ namespace RecrownedAthenaeum.Tools.TextureAtlas
|
||||
ImageHandler ih = imageHandlers[i];
|
||||
regions[i].SetBounds(ih.x, ih.y, ih.Width, ih.Height);
|
||||
regions[i].ninePatchData = ih.ninePatchData;
|
||||
regions[i].ninePatchData.textureName = null;
|
||||
regions[i].name = Path.GetFileNameWithoutExtension(ih.Name);
|
||||
using (Image<Rgba32> image = Image.Load<Rgba32>(ih.path))
|
||||
{
|
||||
@@ -140,12 +141,12 @@ namespace RecrownedAthenaeum.Tools.TextureAtlas
|
||||
}
|
||||
}
|
||||
Directory.CreateDirectory(output);
|
||||
using (FileStream stream = new FileStream(output + "/" + atlasName + ".png", FileMode.Create))
|
||||
using (FileStream stream = new FileStream(output + "/" + atlasName + "-texture" + ".png", FileMode.Create))
|
||||
{
|
||||
atlasTexture.SaveAsPng(stream);
|
||||
}
|
||||
}
|
||||
string serialized = JsonConvert.SerializeObject(new TextureAtlasData(atlasName + ".png", regions), Formatting.Indented);
|
||||
string serialized = JsonConvert.SerializeObject(new TextureAtlasData(atlasName + "-texture" + ".png", regions), Formatting.Indented);
|
||||
File.WriteAllText(output + "/" + atlasName + ".tatlas", serialized);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user