TiledMapImageLayerContent.cs 894 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) Craftwork Games. All rights reserved.
  2. // Licensed under the MIT license.
  3. // See LICENSE file in the project root for full license information.
  4. using System.Collections.Generic;
  5. using System.Xml.Serialization;
  6. using MonoGame.Extended.Tiled;
  7. namespace MonoGame.Extended.Content.Tiled;
  8. public class TiledMapImageLayerContent : TiledMapLayerContent
  9. {
  10. [XmlAttribute(AttributeName = "x")]
  11. public int X { get; set; }
  12. [XmlAttribute(AttributeName = "y")]
  13. public int Y { get; set; }
  14. [XmlElement(ElementName = "image")]
  15. public TiledMapImageContent Image { get; set; }
  16. public TiledMapImageLayerContent()
  17. : base(TiledMapLayerType.ImageLayer)
  18. {
  19. Opacity = 1.0f;
  20. Visible = true;
  21. Properties = new List<TiledMapPropertyContent>();
  22. }
  23. public override string ToString()
  24. {
  25. return $"{Name}: {Image}";
  26. }
  27. }