コード例 #1
0
ファイル: TextEffect.cs プロジェクト: Rohansi/Texter
        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);
        }
コード例 #2
0
ファイル: TextRegion.cs プロジェクト: Rohansi/Texter
        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);
        }
コード例 #3
0
ファイル: TextDisplay.cs プロジェクト: Rohansi/Texter
        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);
        }
コード例 #4
0
ファイル: FlappyBird.cs プロジェクト: Rohansi/FPCompo11
 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);
 }
コード例 #5
0
ファイル: Memory.cs プロジェクト: Rohansi/VM
 public override void Set(int x, int y, Character character, bool blend = true)
 {
     throw new NotImplementedException();
 }