public override void draw(CommonGraphics g) { foreach (ABlock block in blocks) { block.draw(g); } }
public override void draw(CommonGraphics g) { int distance = 30; Point min = new Point(); min.X = info.start.X < info.end.X ? info.start.X : info.end.X; min.Y = info.start.Y < info.end.Y ? info.start.Y : info.end.Y; Point max = new Point(); max.X = info.start.X > info.end.X ? info.start.X : info.end.X; max.Y = info.start.Y > info.end.Y ? info.start.Y : info.end.Y; Point point1 = new Point(); point1.X = min.X + distance; point1.Y = min.Y; Point point2 = new Point(); point2.X = max.X; point2.Y = min.Y; Point point3 = new Point(); point3.X = max.X - distance; point3.Y = max.Y; Point point4 = new Point(); point4.X = min.X; point4.Y = max.Y; Point[] points = { point1, point2, point3, point4 }; g.DrawPolygon(points); }
public GDIImageSaver(List <Shape> shapes) { bmp = new Bitmap(800, 440); bit = System.Drawing.Graphics.FromImage(bmp); this.shapes = shapes; graphics = new GDIPlusCommonGraphics(bit, Color.Black, Color.White, false, 255, 2); }
public override void draw(CommonGraphics g) { g.DrawLine(x + width / 2, x + width, y, y + height / 2); g.DrawLine(x + width, x + width / 2, y + height / 2, y + height); g.DrawLine(x + width / 2, x, y + height, y + height / 2); g.DrawLine(x, x + width / 2, y + height / 2, y); }
public override void draw(CommonGraphics g) { int cx1 = 0, cx2 = 0, cy1 = 0, cy2 = 0; g.DrawLine(x1, x2, y1, y2); if (x2 > x1) { cx1 = cx2 = x2 - 10; } if (x2 < x1) { cx1 = cx2 = x2 + 10; } if (x2 == x1) { cx1 = x2 - 10; cx2 = x2 + 10; } if (y2 > y1) { cy1 = cy2 = y2 - 10; } if (y2 < y1) { cy1 = cy2 = y2 + 10; } if (y2 == y1) { cy1 = y2 - 10; cy2 = y2 + 10; } g.DrawLine(x2, cx2, y2, cy2); g.DrawLine(x2, cx1, y2, cy1); }
public override void draw(CommonGraphics g) { g.DrawLine(x, x + width, y, y); g.DrawLine(x + width, x + width - 20 * width / 150, y, y + height); g.DrawLine(x + width - 20 * width / 150, x - 20 * width / 150, y + height, y + height); g.DrawLine(x - 20 * width / 150, x, y + height, y); }
public CairoImageSaver(List <Shape> s) { bit = img.LockBits(new System.Drawing.Rectangle(0, 0, 800, 440), System.Drawing.Imaging.ImageLockMode.WriteOnly, img.PixelFormat); imgsf = new Cairo.ImageSurface(bit.Scan0, Cairo.Format.Argb32, 800, 440, 800 * 4); ct = new Context(imgsf); shapes = s; g = new CairoCommonGraphics(ct); }
public override void draw(CommonGraphics g) { int width = Math.Abs(info.end.X - info.start.X); int height = Math.Abs(info.end.Y - info.start.Y); int size = width > height ? height : width; g.DrawEclipse(info.start.X, info.start.Y, size, size); }
public SurfingGame(GameWindow window, ContentManager contentManager) : base(window, contentManager) { FontGraphics.LoadContent(contentManager); CommonGraphics.LoadContent(contentManager); SurfingGraphics.LoadContent(contentManager); var level = new SurfLevel(); NextLevel(level); }
public override void draw(CommonGraphics g) { shape.draw(g); new Rectangle(shape.getCornerX() - 5, shape.getCornerY() - 5, 10, 10).draw(e); new Ellipse(shape.getCornerX() + shape.getHeight() / 2 - 5, shape.getCornerY() + shape.getWidth() - 5, 10, 10).draw(e); new Rectangle(shape.getCornerX() + shape.getHeight() - 5, shape.getCornerY() - 5, 10, 10).draw(e); new Rectangle(shape.getCornerX() - 5, shape.getCornerY() + shape.getWidth() - 5, 10, 10).draw(e); new Rectangle(shape.getCornerX() + shape.getHeight() - 5, shape.getCornerY() + shape.getWidth() - 5, 10, 10).draw(e); new Ellipse(shape.getCornerX() + shape.getHeight() / 2 - 5, shape.getCornerY() - 5, 10, 10).draw(e); new Ellipse(shape.getCornerX() + shape.getHeight() - 5, shape.getCornerY() + shape.getWidth() / 2 - 5, 10, 10).draw(e); new Ellipse(shape.getCornerX() - 5, shape.getCornerY() + shape.getWidth() / 2 - 5, 10, 10).draw(e); }
public override void draw(CommonGraphics g) { int scale = 8; Point min = new Point(); min.X = info.start.X < info.end.X ? info.start.X : info.end.X; min.Y = info.start.Y < info.end.Y ? info.start.Y : info.end.Y; Point max = new Point(); max.X = info.start.X > info.end.X ? info.start.X : info.end.X; max.Y = info.start.Y > info.end.Y ? info.start.Y : info.end.Y; int width = Math.Abs(info.end.X - info.start.X); int height = Math.Abs(info.end.Y - info.start.Y); g.DrawRectangle(min.X, min.Y, width, height); Point point1 = new Point(); point1.X = min.X + width / scale; point1.Y = min.Y; Point point2 = new Point(); point2.X = min.X + width / scale; point2.Y = max.Y; Point point3 = new Point(); point3.X = max.X - width / scale; point3.Y = min.Y; Point point4 = new Point(); point4.X = max.X - width / scale; point4.Y = max.Y; g.DrawLine(point1.X, point1.Y, point2.X, point2.Y); g.DrawLine(point3.X, point3.Y, point4.X, point4.Y); }
public override void draw(CommonGraphics g) { g.DrawText(x, y, size, text); }
public override void draw(CommonGraphics g) { g.DrawEllipse(x, y, size, 70 * size / 100); }
public abstract void draw(CommonGraphics g);
public override void draw(CommonGraphics g) { g.DrawEllipse(x, y, size, size * 70 / 100); g.DrawText(x + size * 37 / 100, y + size * 18 / 100, size / 5, "N"); }
public override void draw(CommonGraphics g) { g.DrawEllipse(x, y, size, 70 * size / 100); g.DrawText(x + 41 * size / 100, y + 22 * size / 100, 15 * size / 100, "1"); }
public override void draw(CommonGraphics g) { g.DrawRect(x, y, width, height); }
public override void draw(CommonGraphics g) { g.DrawLine(x1, y1, x2, y2); }
public override void draw(CommonGraphics g) { shape.draw(g); shape.draw(e); }
public ShadowEffect(Shape shape, CommonGraphics effect) { base.shape = shape; base.e = effect; }
public BorderEffect(Shape s, CommonGraphics g) { base.shape = s; base.e = g; }
public override void draw(CommonGraphics g) { g.DrawEllipse(cx, cy, hradius, vradius); }
public override void draw(CommonGraphics g) { g.DrawEllipse(cx, cy, hradius, vradius); g.DrawText(cx + 55 * hradius / 150, cy + 22 * hradius / 150, 15 * hradius / 150, "End"); }
public HighlightEffect(Shape s, CommonGraphics effect) { base.shape = s; base.e = effect; }
public override void draw(CommonGraphics g) { g.DrawRect(x, y, size, size * 70 / 150); g.DrawLine(x + size * 20 / 150, x + size * 20 / 150, y, y + 70 * size / 150); g.DrawLine(x + 130 * size / 150, x + 130 * size / 150, y, y + 70 * size / 150); }