Beispiel #1
0
 public void Paint(TransformedPaintingInfo info, object obj)
 {
     var door = (Door)obj;
     var bounds = info.Transform(door.Bounds.ToRectangleF());
     info.Graphics.FillRectangle(Brushes.Blue, bounds);
     info.Graphics.DrawRectangle(Pens.SkyBlue, bounds);
 }
Beispiel #2
0
        public void Paint(TransformedPaintingInfo info, object obj)
        {
            var room   = (Room)obj;
            var bounds = info.Transform(room.Bounds.ToRectangleF());

            info.Graphics.FillRectangle(darkBrush, bounds);
            info.Graphics.DrawRectangle(Pens.LightGray, bounds);
        }
Beispiel #3
0
        public void Paint(TransformedPaintingInfo info, object obj)
        {
            var scrap  = (ScrapPile)obj;
            var bounds = scrap.Bounds.ToRectangleF();

            bounds.Inflate(-0.25f, -0.25f);
            bounds = info.Transform(bounds);
            info.Graphics.FillEllipse(Brushes.Gold, bounds);
            info.Graphics.DrawEllipse(Pens.Goldenrod, bounds);
        }
        public void Paint(TransformedPaintingInfo info, object obj)
        {
            var obstruction = (Obstruction)obj;
            var bounds      = obstruction.Bounds.ToRectangleF();

            bounds.Inflate(-0.1f, -0.1f);
            bounds = info.Transform(bounds);
            info.Graphics.FillRectangle(Brushes.SaddleBrown, bounds);
            info.Graphics.DrawRectangle(Pens.SandyBrown, bounds);
            info.Graphics.DrawLine(Pens.SandyBrown, bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
            info.Graphics.DrawLine(Pens.SandyBrown, bounds.Right, bounds.Top, bounds.Left, bounds.Bottom);
        }
Beispiel #5
0
        public void Paint(TransformedPaintingInfo info, object obj)
        {
            var drone  = (Drone)obj;
            var bounds = info.Transform(drone.Bounds.ToRectangleF());

            Brush brush;
            Pen   pen;
            Brush textBrush = null;

            if (drone.MaximumHealth <= 0)
            {
                brush = Brushes.DarkRed;
                pen   = Pens.Red;
            }
            else if (drone.Health <= 0)
            {
                brush = Brushes.Olive;
                pen   = Pens.Yellow;
            }
            else
            {
                brush     = Brushes.DarkGreen;
                pen       = Pens.LightGreen;
                textBrush = Brushes.LightGreen;
            }

            info.Graphics.FillEllipse(brush, bounds);
            info.Graphics.DrawEllipse(pen, bounds);
            if (textBrush != null)
            {
                using (var font = new Font(FontFamily.GenericSansSerif, PixelToPointRatio * TextSizeRatio * Math.Min(bounds.Width, bounds.Height)))
                {
                    info.Graphics.DrawString(drone.Name.Remove(1), font, textBrush, bounds, stringFormat);
                }
            }
        }