recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchWriter.cs

27 lines
873 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Newtonsoft.Json;
using RecrownedAthenaeum.Data;
using System.IO;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentTypeWriter]
class NinePatchWriter : ContentTypeWriter<NinePatchData>
{
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "RecrownedAthenaeum.ContentReaders.NinePatchDataReader, RecrownedAthenaeum";
}
protected override void Write(ContentWriter output, NinePatchData value)
{
output.Write(Path.GetFileNameWithoutExtension(value.textureName));
output.Write(value.left);
output.Write(value.right);
output.Write(value.bottom);
output.Write(value.top);
}
}
}