Class VisionOSNativeText
Unity component that provides for the use of platform defined text display and layout using native functionality. Unlike TMP handling where we generate a mesh and use an assigned font material from TMP to render text as a mesh, this component will allow the use of the full fidelity of the platform as best it can.
Where possible, the text will be rendered over a floating slate or canvas so that it does not appear to just be floating in space.
Inherited Members
Namespace: Unity.PolySpatial
Assembly: Unity.PolySpatial.Core.dll
Syntax
[ExecuteInEditMode]
[DisallowMultipleComponent]
public class VisionOSNativeText : MonoBehaviour
Properties
CanvasBackgroundColor
The color of the canvas background that the text will be displayed on. May not be supported on all platforms.
Declaration
public Color CanvasBackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
CanvasCornerRadius
The radius of the rounded corners of teh canvas that the text will be displayed on. Size is in points where one point is equivalent to 0.3528mm. May not be supported on all platforms.
Declaration
public int CanvasCornerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
CanvasSize
The width and height of the canvas that the text will be displayed on. Size is in points where one point is equivalent to 0.3528mm. May not be supported on all platforms.
Declaration
public Vector2 CanvasSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Justification
Horizontal justification of the text.
Declaration
public VisionOSNativeText.HorizontalJustification Justification { get; set; }
Property Value
| Type | Description |
|---|---|
| VisionOSNativeText.HorizontalJustification |
Text
The text to be rendered by the platform.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
TextColor
The color of the text rendered by the platform.
Declaration
public Color TextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
TextEdgeInsets
The margins around the text from the edges of the canvas. Size is in points where one point is equivalent to 0.3528mm.
Declaration
public Vector4 TextEdgeInsets { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector4 |
TextSize
The size of the text to be rendered. Size is in points where one point is equivalent to 0.3528mm.
Declaration
public int TextSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
TmProFontAsset
Handle to the TMP font asset that the user selected for this component.
Declaration
public TMP_FontAsset TmProFontAsset { get; set; }
Property Value
| Type | Description |
|---|---|
| TMP_FontAsset |