Beispiel #1
0
 private void Renderer_Drawing(Graphics.Drawer drawer)
 {
     foreach (var item in Items)
     {
         drawer.DrawRect(item.Position, item.Size);
     }
 }
Beispiel #2
0
 private void Renderer_Drawing(Graphics.Drawer drawer)
 {
     foreach (var c in controls)
     {
         c.OnDraw(drawer);
     }
 }
Beispiel #3
0
        public override void Draw(Graphics.Drawer drawer, Level level, int x, int y)
        {
            base.Draw(drawer, level, x, y);

            Color col      = Color.GreenYellow;
            Color barkCol1 = col;
            Color barkCol2 = col;

            bool u  = level.getTile(x, y - 1) == this;
            bool l  = level.getTile(x - 1, y) == this;
            bool r  = level.getTile(x + 1, y) == this;
            bool d  = level.getTile(x, y + 1) == this;
            bool ul = level.getTile(x - 1, y - 1) == this;
            bool ur = level.getTile(x + 1, y - 1) == this;
            bool dl = level.getTile(x - 1, y + 1) == this;
            bool dr = level.getTile(x + 1, y + 1) == this;

            if (u && ul && l)
            {
                drawer.Draw(x * 16 + 0, y * 16 + 0, 10 + 1 * 32, col, 0);
            }
            else
            {
                drawer.Draw(x * 16 + 0, y * 16 + 0, 9 + 0 * 32, col, 0);
            }
            if (u && ur && r)
            {
                drawer.Draw(x * 16 + 8, y * 16 + 0, 10 + 2 * 32, barkCol2, 0);
            }
            else
            {
                drawer.Draw(x * 16 + 8, y * 16 + 0, 10 + 0 * 32, col, 0);
            }
            if (d && dl && l)
            {
                drawer.Draw(x * 16 + 0, y * 16 + 8, 10 + 2 * 32, barkCol2, 0);
            }
            else
            {
                drawer.Draw(x * 16 + 0, y * 16 + 8, 9 + 1 * 32, barkCol1, 0);
            }
            if (d && dr && r)
            {
                drawer.Draw(x * 16 + 8, y * 16 + 8, 10 + 1 * 32, col, 0);
            }
            else
            {
                drawer.Draw(x * 16 + 8, y * 16 + 8, 10 + 3 * 32, barkCol2, 0);
            }
        }