TiledMapEllipseObject.cs 656 B

1234567891011121314151617
  1. using Microsoft.Xna.Framework;
  2. namespace MonoGame.Extended.Tiled
  3. {
  4. public sealed class TiledMapEllipseObject : TiledMapObject
  5. {
  6. public TiledMapEllipseObject(int identifier, string name, SizeF size, Vector2 position, float rotation = 0, float opacity = 1, bool isVisible = true, string type = null)
  7. : base(identifier, name, size, position, rotation, opacity, isVisible, type)
  8. {
  9. Radius = new Vector2(size.Width / 2.0f, size.Height / 2.0f);
  10. Center = new Vector2(position.X + Radius.X, position.Y);
  11. }
  12. public Vector2 Center { get; }
  13. public Vector2 Radius { get; }
  14. }
  15. }