Ejemplo n.º 1
0
		public override void Draw (DrawContext context)
		{
			RectangleF r = Bounds, l1 = new RectangleF(), l2 = new RectangleF();

			float spacing = .15F;
			float width = .2F;
			
			if (r.Width==0)
			{
				l1 = new RectangleF(r.X,r.Y,0,spacing);
				l2 = new RectangleF(r.X,r.Bottom-spacing,0,spacing);
				r.Height -= spacing*2;
				r.Y += spacing;
				r.Width = width;
				r.X -= width/2;
			}
			else
			{
				r.Width = spacing*2;
				r.X += spacing;
				r.Height = width;
				r.Y -= width/2;
			}

			r = context.TransformF(r);
			l1 = context.TransformF(l1);
			l2 = context.TransformF(l2);
			context.graphics.DrawRectangle(context.WallPen,r.Left,r.Top,r.Width,r.Height);
			context.graphics.DrawLine(context.WallPen,l1.Left,l1.Top,l1.Right,l1.Bottom);
			context.graphics.DrawLine(context.WallPen,l2.Left,l2.Top,l2.Right,l2.Bottom);
		}
Ejemplo n.º 2
0
		public virtual void Draw (DrawContext context)
		{
			RectangleF r = context.Transform(_location.Bounds);
			float spacing = .25F*r.Width;
			context.graphics.FillEllipse(System.Drawing.Brushes.Blue,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2);
			spacing = .38F*r.Width;
			context.graphics.FillEllipse(System.Drawing.Brushes.LightBlue,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2);
		}
Ejemplo n.º 3
0
		public MazeView (MazeGame game, MainForm form)
		{
			_context = new DrawContext(null);
			_game = game;
			_game.View = this;
			_form = form;
			_control = _form.pnlMazeView;
		}
Ejemplo n.º 4
0
		public override void Draw (DrawContext context)
		{
			RectangleF r = context.TransformF(Bounds);
			context.graphics.DrawLine(context.WallPen,r.Left,r.Top,r.Right,r.Bottom);
		}
Ejemplo n.º 5
0
		public override void Draw (DrawContext context)
		{
			if (!context.ClipRect.IntersectsWith(GetDrawingBounds(context)))
				return;

			DrawContents(context);
			foreach (Direction d in Direction.Directions)
			{
				if (Neighbors[d] == null)
				{
					RectangleF r = context.TransformF(GetBorderLine(d));
					context.graphics.DrawLine(context.WallPen,r.Left,r.Top,r.Right,r.Bottom);
				}
				/*
				else if (Neighbors[d] is Room)
				{
					RectangleF r = context.TransformF(GetBorderLine(d));
					context.graphics.DrawLine(context.GridPen,r.Left,r.Top,r.Right,r.Bottom);
				}
				*/
			}
		}
Ejemplo n.º 6
0
		public new Rectangle GetDrawingBounds (DrawContext context)
		{
			return context.Transform(Bounds);
		}
Ejemplo n.º 7
0
		public void DrawContents (DrawContext context)
		{
			RectangleF r = context.TransformF(Bounds);
			//float spacing = .25F*r.Width;
			if (this == context.maze.StartRoom)
			{
				//context.graphics.FillEllipse(System.Drawing.Brushes.Green,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2);
				context.graphics.FillRectangle(System.Drawing.Brushes.LightGreen,r);
			}
			else if (this == context.maze.FinishRoom)
			{
				//context.graphics.FillEllipse(System.Drawing.Brushes.Red,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2);
				r.Offset(1,1);
				context.graphics.FillRectangle(System.Drawing.Brushes.LightPink,r);
			}
			//context.graphics.DrawString(Bounds.X+","+Bounds.Y, new Font("Verdana",7), System.Drawing.Brushes.Gray, r.X, r.Y);
		}
Ejemplo n.º 8
0
		public MapSiteAction_Draw (DrawContext context)
		{
			_context = context;
		}
Ejemplo n.º 9
0
		//default implementation does nothing
		public virtual void Draw (DrawContext context) {}