Vixen
02b45cc4
csharp
public readonly struct OverlayRegion

Somewhere for one overlay to draw: a rectangle it has been given and coordinates relative to it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Relative, so an overlay never has to know which corner it ended up in or what is stacked above it — which is what makes the panels rearrangeable without touching any of them.

Fields and properties (7)

  • public Vector2 Origin

    The top-left of the whole panel, in pixels from the top-left of the screen.

  • public Vector2 Size

    How big the whole panel is.

  • public Vector2 Content

    The top-left of the area inside the padding and below the title.

  • public bool IsEmpty

    Whether there is anywhere to draw. A panel that did not fit is empty rather than off-screen.

  • public float RowHeight

    How far apart two rows of text sit.

  • public float ContentWidth

    How wide the area inside the padding is.

  • public float ContentHeight

    How tall the area inside the padding and below the title is.

Methods (7)

  • public void Text(int row, ReadOnlySpan<char> text, Color4 colour)

    Writes one row of text, counting from the first row under the title.

  • public void Text(Vector2 offset, ReadOnlySpan<char> text, Color4 colour)

    Writes text at an offset from the content origin.

  • public void TextRight(int row, ReadOnlySpan<char> text, Color4 colour)

    Writes text right-aligned to the content's right edge.

  • public void Line(Vector2 from, Vector2 to, Color4 colour)

    Draws a line inside the panel.

  • public void Rect(Vector2 offset, Vector2 size, Color4 colour)

    Draws a rectangle's outline inside the panel.

  • public void Fill(Vector2 offset, Vector2 size, Color4 colour)

    Fills a rectangle inside the panel.

  • public void Meter(int row, ReadOnlySpan<char> label, ReadOnlySpan<char> value, float fraction, Color4 colour)

    Draws a labelled meter: a name, a value, and a bar showing how full it is.

Used by (8)

  • AudioOverlayVixen.Audio
  • ConsoleOverlayVixen.Engine
  • DiagnosticOverlayTestsVixen.Engine.Tests
  • FrameGraphOverlayVixen.Engine
  • FrameStatsOverlayVixen.Engine
  • LogOverlayVixen.Engine
  • OverlaySurfaceVixen.Engine
  • RecordingVixen.Engine.Tests