Files
MonoGame.Extended/Source/MonoGame.Extended.Tiled/TiledMapImageLayer.cs
T
2017-01-31 21:15:21 +10:00

23 lines
730 B
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Content;
namespace MonoGame.Extended.Tiled
{
public class TiledMapImageLayer : TiledMapLayer, IMovable
{
public Vector2 Position { get; set; }
public Texture2D Texture { get; }
internal TiledMapImageLayer(ContentReader input)
: base(input)
{
var textureAssetName = input.GetRelativeAssetName(input.ReadString());
Texture = input.ContentManager.Load<Texture2D>(textureAssetName);
var x = input.ReadSingle();
var y = input.ReadSingle();
Position = new Vector2(x, y);
}
}
}