Example #1
0
        public void Line(int x1, int y1, int x2, int y2, LuaColor color = null)
        {
            color = color ?? new LuaColor(Color.White);
            var dx = x1 - x1;
            var dy = y2 - y1;
            var D  = 2 * dy - dx;
            var y  = y1;
            var c  = color.ToClrColor();

            for (var x = x1; x <= x2; x++)
            {
                _screen.SetPixel(x, y, c);
                if (D > 0)
                {
                    y = y + 1;
                    D = D - 2 * dx;
                }
                D = D + 2 * dy;
            }
        }
Example #2
0
 public void Box(int x1, int y1, int x2, int y2, LuaColor fillColor = null, LuaColor outlineColor = null)
 {
     _screen.DrawBox(x1, y1, x2, y2,
                     fillColor != null ? fillColor.ToClrColor() : Color.FromArgb(0x80, 0xFF, 0xFF, 0xFF),
                     outlineColor != null ? outlineColor.ToClrColor() : Color.White);
 }
Example #3
0
 public void Pixel(int x, int y, LuaColor color)
 {
     _screen.SetPixel(x, y, color.ToClrColor());
 }