| 12345678910111213141516171819202122232425262728293031323334353637 |
- using Microsoft.Xna.Framework;
- namespace MonoGame.Extended.Tilemaps
- {
- /// <summary>
- /// Represents a rectangular object in a tilemap.
- /// </summary>
- public class TilemapRectangleObject : TilemapObject
- {
- /// <summary>
- /// Gets or sets the size of the rectangle.
- /// </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="size">The size of the rectangle.</param>
- public TilemapRectangleObject(int id, Vector2 position, Vector2 size) : base(id, position)
- {
- Size = size;
- }
- }
- }
|