Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DrawText(string, Vector2, float, Color, FontAsset)

Draw a string of text.
Read time 1 minuteLast updated 9 days ago

Definition

public void DrawText(string text, Vector2 pos, float fontSize, Color color, FontAsset font = null)

Parameters

text

The text to display.

The start position where the text will be displayed.

fontSize

The font size to use.

color

The text color.

font

FontAsset
The font asset to use. If the value is null, the font asset of the VisualElement style is used instead. For more information, refer to _unityFontDefinition.