TiledMapEffect.cs 900 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Microsoft.Xna.Framework.Graphics;
  2. using MonoGame.Extended.Graphics.Effects;
  3. namespace MonoGame.Extended.Tiled.Renderers
  4. {
  5. public interface ITiledMapEffect : IEffectMatrices, ITextureEffect
  6. {
  7. float Alpha { get; set; }
  8. }
  9. public class TiledMapEffect : DefaultEffect, ITiledMapEffect
  10. {
  11. public TiledMapEffect(GraphicsDevice graphicsDevice)
  12. : base(graphicsDevice)
  13. {
  14. Initialize();
  15. }
  16. public TiledMapEffect(GraphicsDevice graphicsDevice, byte[] byteCode)
  17. : base(graphicsDevice, byteCode)
  18. {
  19. Initialize();
  20. }
  21. public TiledMapEffect(Effect cloneSource)
  22. : base(cloneSource)
  23. {
  24. Initialize();
  25. }
  26. private void Initialize()
  27. {
  28. VertexColorEnabled = false;
  29. TextureEnabled = true;
  30. }
  31. }
  32. }