Exemplo n.º 1
0
        public void Set(int x, int y, Character character, bool useBlending = true)
        {
            if (x < 0 || x > Width - 1 || y < 0 || y > Height - 1)
                return;

            if (useBlending && character.HasTransparentComponent)
            {
                var glyph = character.Glyph;
                var fore = character.Foreground;
                var back = character.Background;

                var ch = Get(x, y);

                if (glyph == -1)
                    glyph = ch.Glyph;

                if (fore == -1)
                    fore = ch.Foreground;

                if (back == -1)
                    back = ch.Background;

                character = new Character(glyph, fore, back);
            }

            _renderer.Set(x, y, _effect(x, y, character), useBlending);
        }
Exemplo n.º 2
0
        public void Set(int x, int y, Character character, bool useBlending = true)
        {
            if (x < 0 || x > Width - 1 | y < 0 | y > Height - 1)
                return;

            _renderer.Set(_startX + x, _startY + y, character, useBlending);
        }
Exemplo n.º 3
0
        public void Set(int x, int y, Character character, bool useBlending = true)
        {
            if (x < 0 || x > Width - 1 || y < 0 || y > Height - 1)
                return;

            var glyph = character.Glyph;
            var fore = character.Foreground;
            var back = character.Background;

            if (character.HasTransparentComponent)
            {
                if (useBlending)
                {
                    var ch = Get(x, y);

                    if (glyph == -1)
                        glyph = ch.Glyph;

                    if (fore == -1)
                        fore = ch.Foreground;

                    if (back == -1)
                        back = ch.Background;
                }
                else
                {
                    if (glyph == -1)
                        glyph = 0;

                    if (fore == -1)
                        fore = 0;

                    if (back == -1)
                        back = 0;
                }
            }

            var color = new Color((byte)glyph, (byte)fore, (byte)back);
            _data.SetPixel((uint)x, (uint)y, color);
        }
Exemplo n.º 4
0
 private void Draw(ITextRenderer renderer, float x, float y, uint w, uint h, Character color)
 {
     renderer.DrawBox((int)x - _camera, (int)y, w, h, GuiSettings.SolidBox, color);
 }
Exemplo n.º 5
0
Arquivo: Memory.cs Projeto: Rohansi/VM
 public override void Set(int x, int y, Character character, bool blend = true)
 {
     throw new NotImplementedException();
 }