WebFontToString

public string WebFontToString(ElementProperties.WebFont font);

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);
    }
}

Returns the stylesheet compatible string for a selected font.

 

font A webfont. This must be an option from the ElementProperties.WebFont enumerator.

ElementProperties.WebFont

  • Georgia
  • PalatinoLinotype
  • TimesNewRoman
  • Arial
  • ArialBlack
  • ComicSansMS
  • Helvetica
  • Impact
  • LucidaSansUnicode
  • Tahoma
  • TrebuchetMS
  • Verdana
  • CourierNew
  • LucidaConsole