summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Renderers/TiledMapEffect.cs
blob: b24e2e98fdaae864a8c9df6a4fd3f7c92bd816ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Graphics.Effects;

namespace MonoGame.Extended.Tiled.Renderers
{
    public interface ITiledMapEffect : IEffectMatrices, ITextureEffect
    {
        float Alpha { get; set; }
    }

    public class TiledMapEffect : DefaultEffect, ITiledMapEffect
    {
        public TiledMapEffect(GraphicsDevice graphicsDevice) 
            : base(graphicsDevice)
        {
            Initialize();
        }

        public TiledMapEffect(GraphicsDevice graphicsDevice, byte[] byteCode) 
            : base(graphicsDevice, byteCode)
        {
            Initialize();
        }

        public TiledMapEffect(Effect cloneSource) 
            : base(cloneSource)
        {
            Initialize();
        }

        private void Initialize()
        {
            VertexColorEnabled = false;
            TextureEnabled = true;
        }
    }
}