recrownedathenaeum/RecrownedAthenaeum/ContentReaders/NinePatchDataReader.cs

17 lines
608 B
C#
Raw Normal View History

using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.SpecialTypes;
2019-01-21 03:45:15 +00:00
namespace RecrownedAthenaeum.ContentReaders
{
class NinePatchDataReader : ContentTypeReader<NinePatch>
{
protected override NinePatch Read(ContentReader input, NinePatch existingInstance)
{
Texture2D texture = input.ContentManager.Load<Texture2D>(input.ReadString());
NinePatch ninePatch = new NinePatch(texture, input.ReadInt32(), input.ReadInt32(), input.ReadInt32(), input.ReadInt32());
return ninePatch;
}
}
}