Ejemplo n.º 1
0
        public void Draw(Grid grid)
        {
            Graphics g = Panel.CreateGraphics();
            g.DrawImage(Image, 0, 0, Width, Height);
            g.Dispose();

            if (grid != null)
            {
                grid.Draw(Panel);
            }
        }
Ejemplo n.º 2
0
        private void pictureBoxMap_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            map.Paint(g);

            grid.Width  = map.Size;
            grid.Height = map.Size;

            Point startPosition = new Point(0, 0);

            grid.Draw(g, startPosition);
        }
Ejemplo n.º 3
0
        public void Draw(Grid grid, TileSet tileSet)
        {
            // Screen block entries
            for (int x = 0; x < Width; x++)
            for (int y = 0; y < Height; y++)
            {
                DrawTile(x, y, tileSet);
            }

            if (grid != null)
            {
                grid.Draw(Panel);
            }
        }
Ejemplo n.º 4
0
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.DrawImage(currentTileset.AllTiles, 0, 0);

            grid.Width  = this.Width;
            grid.Height = this.Height;

            Point startPosition = new Point(0, 0);

            grid.Draw(e.Graphics, startPosition);

            Pen pen = new Pen(Color.LimeGreen)
            {
                Width     = 5,
                DashStyle = System.Drawing.Drawing2D.DashStyle.Dash
            };

            e.Graphics.DrawLines(pen, points);
            pen.Dispose();

            base.OnPaint(e);
        }