public void Draw(SpriteBatch spriteBatch, DrawContext ctx) { var size = ctx.Size; var color = ctx.Modulate.ModulateColor(Color); var radius = Radius; var position = ctx.Position; CustomDrawing.DrawRect(position + new Vector2(0, radius), size - new Vector2(0, radius * 2), color); CustomDrawing.DrawRect(position + new Vector2(radius, 0), new Vector2(size.X - radius * 2, radius), color); CustomDrawing.DrawRect(position + new Vector2(radius, size.Y - radius), new Vector2(size.X - radius * 2, radius), color); CustomDrawing.DrawCircleCorner(position, radius, color, TopLeft); CustomDrawing.DrawCircleCorner(position + new Vector2(size.X - radius, 0), radius, color, TopRight); CustomDrawing.DrawCircleCorner(position + new Vector2(0, size.Y - radius), radius, color, BottomLeft); CustomDrawing.DrawCircleCorner(position + new Vector2(size.X - radius, size.Y - radius), radius, color, BottomRight); }
public void DrawLine(Vector2 start, Vector2 end, int width, Color color) { CustomDrawing.DrawLine(_screenPos + start, _screenPos + end, width, _modulate.ModulateColor(color)); UpdateDrawBounds(start - new Vector2(width / 2), new Vector2(width)); UpdateDrawBounds(end - new Vector2(width / 2), new Vector2(width)); }
public void DrawEqTriangle(Vector2 basePos, Vector2 size, Color color, bool flip = false) { CustomDrawing.DrawEqTriangle(_screenPos + basePos, size, _modulate.ModulateColor(color), flip); UpdateDrawBounds(basePos - new Vector2(size.X / 2, size.Y), size); }
public void DrawEllipse(Vector2 position, Vector2 size, Color color) { CustomDrawing.DrawEllipse(_screenPos + position, size, _modulate.ModulateColor(color)); UpdateDrawBounds(position, size); }
public void DrawCircle(Vector2 position, int radius, Color color) { CustomDrawing.DrawCircle(_screenPos + position, radius, _modulate.ModulateColor(color)); UpdateDrawBounds(position - new Vector2(radius), new Vector2(radius) * 2); }
public void DrawRect(Vector2 centrePos, Vector2 size, Color color, float angle) { CustomDrawing.DrawRect(_screenPos + centrePos, size, _modulate.ModulateColor(color), angle); UpdateDrawBounds(centrePos - size / 2, size); }
public void Draw(SpriteBatch spriteBatch, DrawContext ctx) => CustomDrawing.DrawRect(ctx.Position, ctx.Size, ctx.Modulate.ModulateColor(Color));