recrownedgtk/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchWriter.cs

25 lines
859 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Newtonsoft.Json;
using RecrownedAthenaeum.Data;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentTypeWriter]
class NinePatchWriter : ContentTypeWriter<NinePatchProcessor.Package>
{
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "RecrownedAthenaeum.ContentReaders.NinePatchDataReader, RecrownedAthenaeum";
}
protected override void Write(ContentWriter output, NinePatchProcessor.Package value)
{
output.Write(value.textureBytes.Length);
output.Write(value.textureBytes);
output.Write(value.ninePatchDataBytes.Length);
output.Write(value.ninePatchDataBytes);
}
}
}