changing font for action text

  • #1, by JoemcrTuesday, 21. April 2015, 10:03 9 years ago
    Quick question: is there an easy way to change the font of the action text during gameplay?

    thanks

    Newbie

    96 Posts


  • #2, by afrlmeTuesday, 21. April 2015, 14:52 9 years ago
    What do you mean by change the font? Are you referring to the font itself, or the text?

    Imperator

    7278 Posts

  • #3, by JoemcrTuesday, 21. April 2015, 15:01 9 years ago
    the font. In one scene my on-screen interface changes, i want to change the font of the action text at the same time so it matches the style of the new interface...

    Newbie

    96 Posts

  • #4, by afrlmeTuesday, 21. April 2015, 15:46 9 years ago
    According to the data structure it's not scriptable, but you can try it anyway.
    game:setValue(VGameActionTextFont, getObject("Fonts[font_name]"))
    

    ...to be honest, I have no clue if the code is correct or not as I've not tested it.

    * edit: ah it might work for updating text for current session. It doesn't save the data to the save files is all.

    Imperator

    7278 Posts

  • #5, by JoemcrTuesday, 21. April 2015, 16:09 9 years ago
    Thanks! seems to work... If i have it executing 'on beginning of scene' it should work when loading from a save as well, no?

    Newbie

    96 Posts

  • #6, by afrlmeTuesday, 21. April 2015, 16:29 9 years ago
    I think the best thing to do would be to create a small function that let's you change to whatever text you like. Then you can call the function on mouse over / out of objects, characters etc. That way, you could have full control as needed. Would be a bit of work on your part though.

    definition script...
    function setATF(n)
     game:setValue(VGameActionTextFont, getObject("Fonts[" .. n .. "]"))
    end
    

    to use: create execute a script action, containing...
    setATF("font_name")
    

    ... simple enough, no?

    Or you could do it at beginning of the scene as you said - which will probably be more ideal if everything in that scene is to use the same action text font. Just make sure you set it back to the default text in an at end of scene action, if required.

    Imperator

    7278 Posts

  • #7, by JoemcrTuesday, 21. April 2015, 16:46 9 years ago
    Nothing is simple enough for me! I have no clue what I'm doing 90% of the time... the font will be the same for the whole scene though, so hopefully calling it at the start/end of the scene should do the job.

    Thanks

    Newbie

    96 Posts

  • #8, by afrlmeTuesday, 21. April 2015, 17:36 9 years ago
    Yep. No problem. wink

    Imperator

    7278 Posts