Table of Contents

Class OrientationGizmoRenderer

Namespace
Stride.CommunityToolkit.Rendering.Gizmos
Assembly
Stride.CommunityToolkit.dll

Draws the world axes in a corner of the screen, turning with the camera, the way Game Studio's space marker shows which way is which in the scene editor.

public sealed class OrientationGizmoRenderer : SceneRendererBase, IComponent, IReferencable, ICollectorHolder, ISceneRenderer, IRenderCollector, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
Inheritance
OrientationGizmoRenderer
Implements
Inherited Members

Remarks

Each axis is an arrow from the centre, a shaft and a cone head in the editor's proportions, with its letter in white just past the tip; the negative halves are small unlettered discs. Ends pointing away from the camera are drawn first and dimmer, so the three arrows read as a solid tripod however the camera turns. The gizmo is screen-space, drawn after the scene and over it, and ignores depth. Its size follows the display scale while AutoScale is on.

Add it with game.AddOrientationGizmo(), or put an instance in the compositor with AddSceneRenderer. The axis colours are those of the ground gizmo and the editor: red X, green Y, blue Z.

Fields

ProfilingKey

The profiling key the renderer draws under.

public static readonly ProfilingKey ProfilingKey

Field Value

ProfilingKey

Properties

Anchor

The corner or edge of the screen the gizmo sits in. The default is the bottom left.

public ScreenAnchor Anchor { get; set; }

Property Value

ScreenAnchor

AutoScale

Whether the sizes follow the display scale, so the gizmo is the same physical size on every monitor.

public bool AutoScale { get; set; }

Property Value

bool

FontSize

The size of the axis letters, in pixels before the display scale.

public float FontSize { get; set; }

Property Value

float

LabelColor

The colour of the axis letters. A faint shadow under them keeps them readable on a light sky.

public Color LabelColor { get; set; }

Property Value

Color

Margin

The distance from the screen edge to the gizmo's reach, in pixels before the display scale.

public Int2 Margin { get; set; }

Property Value

Int2

Opacity

The whole gizmo's opacity, 0 to 1.

public float Opacity { get; set; }

Property Value

float

ShowLabels

Whether the arrows carry their axis letter past the tip.

public bool ShowLabels { get; set; }

Property Value

bool

ShowNegativeEnds

Whether the negative halves are drawn, as small unlettered discs.

public bool ShowNegativeEnds { get; set; }

Property Value

bool

Size

The length of an arrow from the centre to its tip, in pixels before the display scale. The other sizes follow it.

public float Size { get; set; }

Property Value

float

XColor

The colour of the X axis.

public Color XColor { get; set; }

Property Value

Color

YColor

The colour of the Y axis.

public Color YColor { get; set; }

Property Value

Color

ZColor

The colour of the Z axis.

public Color ZColor { get; set; }

Property Value

Color

Methods

Destroy()

protected override void Destroy()

DrawCore(RenderContext, RenderDrawContext)

protected override void DrawCore(RenderContext context, RenderDrawContext drawContext)

Parameters

context RenderContext
drawContext RenderDrawContext

InitializeCore()

protected override void InitializeCore()