Table of Contents

Class TextExtensions

public static class TextExtensions
Inheritance
TextExtensions

Methods

Align(ref Text, TextAlign)

Controls how the text is positioned relative to its origin.

public static ref Text Align(this ref Text @this, TextAlign align)

Parameters

this Text
align TextAlign

Returns

Text

Color(ref Text, Color?)

Set the color for this Text.

public static ref Text Color(this ref Text @this, Color? color)

Parameters

this Text
color Color?

Returns

Text

FaceCamera(ref Text)

Make the visual always face the camera.

public static ref Text FaceCamera(this ref Text @this)

Parameters

this Text

Returns

Text

Facing(ref Text, Facing)

The facing direction of this text.

public static ref Text Facing(this ref Text @this, Facing facing)

Parameters

this Text
facing Facing

Returns

Text

Position(ref Text, float3)

Set the position for this Text.

public static ref Text Position(this ref Text @this, float3 position)

Parameters

this Text
position float3

Returns

Text

Ref(Text)

Returns a reference to the previously created Text(ref Text, ReadOnlySpan<char>) visual.
If you need to keep a reference to a long-lived visual, this will allow you to modify or delete the visual at some point in the future.

Important: only use this directly after creating a visual, as it may not be valid beyond that.

public static VisualRef<Text> Ref(this Text @this)

Parameters

this Text

Returns

VisualRef<Text>

Rotation(ref Text, float)

Sets the facing rotation an degrees.

public static ref Text Rotation(this ref Text @this, float rotation)

Parameters

this Text
rotation float

Returns

Text

SetDefault(ref Text)

public static ref Text SetDefault(this ref Text @this)

Parameters

this Text

Returns

Text

Size(ref Text, Size)

The size of a line of text in world space.

public static ref Text Size(this ref Text @this, Size size)

Parameters

this Text
size Size

Returns

Text

Text(ref Text, ReadOnlySpan<char>)

Set the text from a span.

public static ref Text Text(this ref Text @this, ReadOnlySpan<char> text)

Parameters

this Text
text ReadOnlySpan<char>

Returns

Text