recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs

26 lines
860 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using RecrownedAthenaeum.Data;
using System.Text;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentImporter(DisplayName = "Nine Patch - RecrownedAthenaeum")]
class NinePatchProcessor : ContentProcessor<NinePatchImporter.Package, NinePatchProcessor.Package>
{
public override Package Process(NinePatchImporter.Package input, ContentProcessorContext context)
{
Package package;
package.ninePatchDataBytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(input.ninePatchData));
package.textureBytes = input.textureBytes;
return package;
}
internal struct Package
{
internal byte[] ninePatchDataBytes;
internal byte[] textureBytes;
}
}
}