예제 #1
0
 public override Fragment8 Compute(Vector2d16 current, Vector2d16 start, Vector2d16 end)
 {
     if (text.Length <= current._2 || text[current._2].Length <= current._1)
     {
         return(Fragment8.GetNull());
     }
     return(new Fragment8(new Color8(255, 255, 255), Color8.GetNull(), text[current._2][current._1]));
 }
예제 #2
0
        public override Fragment8 Compute(Vector2d16 current, Vector2d16 start, Vector2d16 end)
        {
            char ch = (char)atlas.GetData(this.start - start + current);

            if (ch == 0)
            {
                return(Fragment8.GetNull());
            }
            return(new Fragment8(new Color8(255, 255, 255), Color8.GetNull(), ch));
        }
예제 #3
0
        public override void Render(Shader shader, Vector2d16 position)
        {
            Vector2d16 start = new Vector2d16(0, 0);
            Vector2d16 end   = dimensions;

            for (int y = 0; y < dimensions._2; ++y)
            {
                for (int x = 0; x < dimensions._1; ++x)
                {
                    int posX = position._1 - Renderer.worldPosition._1 + x;
                    int posY = position._2 - Renderer.worldPosition._2 + y;
                    if (posX < 0 || posX >= (Renderer.Width) || posY < 0 || posY >= (Renderer.Height))
                    {
                        continue;
                    }
                    Fragment8 frag = shader.Compute(new Vector2d16(x, y), start, end);
                    if (!frag.IsNull())
                    {
                        Renderer.buffer[posY, posX] = frag;
                    }
                }
            }
        }
예제 #4
0
        public override Fragment8 Compute(Vector2d16 current, Vector2d16 start, Vector2d16 end)
        {
            if (text.Length <= current._2 || text[current._2].Length <= current._1)
            {
                return(Fragment8.GetNull());
            }
            switch (text[current._2][current._1])
            {
            case '#':     //Bold
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB80));

            case '|':     //Faint
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB81));

            case '/':     //Italic
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB82));

            case '_':     //Underlined
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB83));

            case '^':     //Blink
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB84));

            case '%':     //Crossed-out
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB85));

            case '~':     //Video inverse
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB86));

            case '@':     //Fraktur
                return(new Fragment8(foreground, Color8.GetNull(), (char)0xDB87));

            default:
                return(new Fragment8(foreground, Color8.GetNull(), text[current._2][current._1]));
            }
        }