Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 public void DrawEllipse(Vector2 position, Vector2 size, Color color)
 {
     CustomDrawing.DrawEllipse(_screenPos + position, size, _modulate.ModulateColor(color));
     UpdateDrawBounds(position, size);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 public void Draw(SpriteBatch spriteBatch, DrawContext ctx) =>
 CustomDrawing.DrawRect(ctx.Position, ctx.Size, ctx.Modulate.ModulateColor(Color));