en:vci:component:sdk:text

Display text with VCI

You can export the text object created with TextMeshPro and display it in VirutalCast.

  • To create a VCI with texts, you need VCI v0.23 or later.
  • Supported version of Unity is 2018.4.5f1.
  • Supported version of TextMeshPro is 1.4.1.
  • You can check and choose the version of TextMeshPro in Package Manager ([Window]>[PackageManager]).

Adding texts

After creating a VCIObject, choose from the menu bar [GameObject]>[VCI]>[Text], to create a text object.

If it's your first time, you will be shown the TextMeshPro initial settings menu. Click on [Import TMP Essentials] to import the required assets.

By including the created text object in VCIObject and exporting VCI, you can show it in VirtualCast.

Exportable parameters

You can export the following parameters in TextMeshPro.

MainSettings

  • Text
  • Font Style
  • Font Size
  • Auto Size
  • Vertex Color
  • Color Gradient: Color Mode, Colors
  • SpacingOptions: Character, Word, Line, Paragraph
  • Alignment
  • Wrapping
  • Overflow

ExtraSettings

  • Margin
  • RichText
  • Kerning
  • ExtraPadding

About fonts

By default, you can not display Japanese text as the font is set to LiberationSans SDF. However, in VirutalCast, the text is converted into a Japanese font (NotoSansCJKjp-Bold) so that it can be displayed.

If you want to check how Japanese text is being displayed on Unity while developing VCI, download font asset for TextMeshPro from the link below and attach NotoSansCJK-Bold_SDF to FontAsset on the TextMeshPro component. TMP_NotoSansCJK.unitypackage

The font asset used:

Noto Sans CJK JP

https://www.google.com/get/noto/#sans-jpan

Modification from Lua scripts

You can change the text with codes such as bellow.

main.lua
vci.assets._SetText("The name of the GameObject with the text", "The text")
vci.assets._ALL_SetText("The name of the GameObject with the text", "The text")

If GameObjects with the same name exist under a VCIObject, all the texts will be modified.

en/vci/component/sdk/text.txt · Last modified: 2023/05/11 20:13 by pastatto

Page Tools