TiledMapLayer.cs 883 B

1234567891011121314151617181920212223242526
  1. using Microsoft.Xna.Framework;
  2. namespace MonoGame.Extended.Tiled
  3. {
  4. public abstract class TiledMapLayer
  5. {
  6. public string Name { get; }
  7. public string Type { get; }
  8. public bool IsVisible { get; set; }
  9. public float Opacity { get; set; }
  10. public Vector2 Offset { get; set; }
  11. public Vector2 ParallaxFactor { get; set; }
  12. public TiledMapProperties Properties { get; }
  13. protected TiledMapLayer(string name, string type, Vector2? offset = null, Vector2? parallaxFactor = null, float opacity = 1.0f, bool isVisible = true)
  14. {
  15. Name = name;
  16. Type = type;
  17. Offset = offset ?? Vector2.Zero;
  18. ParallaxFactor = parallaxFactor ?? Vector2.One;
  19. Opacity = opacity;
  20. IsVisible = isVisible;
  21. Properties = new TiledMapProperties();
  22. }
  23. }
  24. }