TextAlignement

public ElementProperties.Alignement TextAlignement;

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    void OnConnect(VPlayer player)
    {
        // New element properties
        ElementProperties ep = new ElementProperties();
        ep.Text = "Hello World";
        ep.TextAlignment = ElementProperties.Alignement.Right;
        ep.PaddingVertical = 5;
        ep.PaddingHorizontal = 10;
        ep.Font = WebFontToString(ElementProperties.WebFont.TimesNewRoman);
        ep.FontSize = 16;
        ep.FontColor = Color.green;

        // Apply element properties
        player.ChangeElementProperties("text", ep);
    }
}

Sets the alignement of this text element with an option from the ElementProperties.Alignement enumerator.

ElementProperties.Alignement

  • Left
  • Right
  • Center
  • Justify