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