recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchWriter.cs
2021-12-23 21:27:41 -06:00

27 lines
873 B
C#
Executable File

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);
}
}
}