Skip to content

OverlayShapes

namespace Griff.Runtime;
public static class OverlayShapes

Shapes and colors the genres’ overlays and HUDs draw with, belonging to the screen rather than any entity.

public static IEnumerable<SpriteDraw> Circle(Vector2 center, float radius, float thickness, Color color)

The outline of a circle (see Circle).

public static Vector2 Flat(Vector3 v)

A position in 3D without its height: the 2D point the world draws it at.

public static Color HealthColor(float fraction)

The color a health bar fills with: Mine while healthy, Neutral while hurt, Theirs when nearly gone.

public static SpriteDraw Label(string text, Vector2 at, float size, Color color, TextAlign align)

Text drawn at a position (see Label).

public static SpriteDraw LineDraw(Vector2 from, Vector2 to, float thickness, Color color)

A line between two points (see Line).

public static IEnumerable<SpriteDraw> Meter(Vector2 center, float width, float height, float fraction, Color fill)

A bar: dark behind, filled from the left by fraction.

public static IEnumerable<SpriteDraw> Outline(Vector2 center, Vector2 size, float thickness, Color color)

The outline of a rectangle (see Outline).

public static SpriteDraw Quad(Vector2 center, Vector2 size, Color color)

A solid rectangle in the world.

public static readonly Color HudBack

The dark background of a HUD panel.

public static readonly Color HudDim

The color of a HUD’s less important text.

public static readonly Color HudEdge

The edge of a HUD panel.

public static readonly Color HudText

The color of a HUD’s text.

public static readonly Color Mine

The color of what is the player’s own.

public static readonly Color Neutral

The color of what belongs to no one, or is half-way between good and bad.

public static readonly Color Theirs

The color of what belongs to an opponent.