Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Change Object Text Font with Lua

  • #1, by dionous 9 years ago Zitieren
    Hi all,

    What would be the best way to change the object text font with LUA? Checking the data structure i can see :

    GameObjectFont -> The font used when displaying an object text.

    and

    GameFontLinks -> All fonts of the game.



  • #2, by sebastian 9 years ago Zitieren
    before displaying an object text (and after displaying the text setting it back to default):

    game:setValue(VGameObjectFont,"Fonts[my_font_name]")
  • #3, by dionous 9 years ago Zitieren
    great thanks!
  • #4, by sebastian 9 years ago Zitieren
    im not sure, but
    game.GameObjectFont = Fonts["my_font_name"]

    will may work, too. Looks a bit cleaner...

  • #5, by SimonS 9 years ago Zitieren
    game.ObjectFont = Fonts.my_font_name
    would be even shorter.
  • #6, by afrlme 9 years ago Zitieren
    game.ObjectFont = Fonts.my_font_name
    would be even shorter.
    I'm not so keen on that method because it's not as clear. I like to separate the tables with . & access the visObj with ["this"] because it's much easier to spot what's what when you are scripting & something is incorrect or you need to change the name of the visOBJ you are accessing.

  • #7, by dionous 9 years ago Zitieren
    Thanks all,

    both

    game:setValue(VGameObjectFont,"Fonts[my_font_name]")

    and
    game.ObjectFont = Fonts.my_font_name

    work nicely!