using Microsoft.Xna.Framework;
namespace MonoGame.Extended.Tilemaps
{
///
/// Represents an object that displays a tile from a tileset.
///
public class TilemapTileObject : TilemapObject
{
///
/// Gets or sets the tile data
///
public TilemapTile Tile {get; set;}
///
/// Gets or sets the size of the tile object.
///
public Vector2 Size { get; set; }
///
public override RectangleF Bounds
{
get
{
return new RectangleF(Position.X, Position.Y, Size.X, Size.Y);
}
}
// NOTE: Will use BoundingBox2D or OrientedBoundingBox2D
///
/// Initializes a new instance of the class.
///
/// The unique identifier for the object.
/// The position of the top-left corner.
/// The tile data.
/// The size of the rectangle.
public TilemapTileObject(int id, Vector2 position, TilemapTile tile, Vector2 size) : base(id, position)
{
Tile = tile;
Size = size;
}
}
}