public override void Draw (DrawBatch drawBatch) { drawBatch.DrawLine(_gradWidth, new Vector2(25, 25), new Vector2(125, 125)); drawBatch.DrawCircle(_gradWidth, new Vector2(200, 75), 50); drawBatch.DrawPath(_widthStar); drawBatch.DrawLine(_gradLength, new Vector2(25, 150), new Vector2(125, 250)); drawBatch.DrawCircle(_gradLength, new Vector2(200, 200), 50); drawBatch.DrawPath(_lengthStar); }
private void RenderPartialHorizontalLine(DrawBatch drawBatch, float zoomFactor, int x1, int x2, int y) { int top = (int)((y + _data.Offset.Y) * _data.TileHeight * zoomFactor); int left = (int)((x1 + _data.Offset.X) * _data.TileWidth * zoomFactor); int right = (int)((x2 + _data.Offset.X + 1) * _data.TileWidth * zoomFactor); drawBatch.DrawLine(Outline, new Vector2(left, top), new Vector2(right, top)); }
public override void Draw(DrawBatch drawBatch) { drawBatch.DrawLine(_thickBlue, new CCVector2(50, 50), new CCVector2(250, 50)); drawBatch.DrawPath(_wavyPath); drawBatch.DrawRectangle(_thickMagenta, new CCRect(50, 160, 200, 100)); drawBatch.DrawCircle(_thickBlack, new CCVector2(350, 100), 50); drawBatch.DrawCircle(_thickDarkGray, new CCVector2(350, 225), 50, 16); drawBatch.DrawRectangle(_thickGreen, new CCRect(50, 350, 200, 100), (float)Math.PI / 4f); }
public override void Draw (DrawBatch drawBatch) { for (int i = 0; i < _gPaths.Length; i++) { GraphicsPath path = _gPaths[i]; drawBatch.DrawPath(path); for (int j = 0; j < _baseCoords.Length - 1; j++) drawBatch.DrawLine(PrimitivePen.Black, _baseCoords[j] + Offset(i), _baseCoords[j + 1] + Offset(i)); } }
protected override void RenderContent(DrawBatch drawBatch) { ILevelGeometry geometry = LevelGeometry; Rectangle levelBounds = geometry.LevelBounds.ToXnaRectangle(); Rectangle bounds = new Rectangle( (int)Math.Ceiling(levelBounds.X * geometry.ZoomFactor), (int)Math.Ceiling(levelBounds.Y * geometry.ZoomFactor), (int)(levelBounds.Width * geometry.ZoomFactor), (int)(levelBounds.Height * geometry.ZoomFactor) ); if (levelBounds.X != 0) drawBatch.DrawLine(Pens.Gray, new Vector2(0, bounds.Top), new Vector2(0, bounds.Bottom)); if (levelBounds.Y != 0) drawBatch.DrawLine(Pens.Gray, new Vector2(bounds.Left, 0), new Vector2(bounds.Right, 0)); drawBatch.DrawRectangle(Pens.Black, bounds); }
private void RenderPartialVerticalLine(DrawBatch drawBatch, float zoomFactor, int x, int y1, int y2) { int left = (int)((x + _data.Offset.X) * _data.TileWidth * zoomFactor); int top = (int)((y1 + _data.Offset.Y) * _data.TileHeight * zoomFactor); int bottom = (int)((y2 + _data.Offset.Y + 1) * _data.TileHeight * zoomFactor); drawBatch.DrawLine(Outline, new Vector2(left, top), new Vector2(left, bottom)); }