Graphics

 View Only
  • 1.  Font Selector

    Posted 08-26-2015 01:38
    I'm trying to setup a selector script that occurs onOnline that changes a font based on a hidden text field. I'm using the dim as xpFont, engine.GetFontByName and text.CurrentFont = fontChoice. I cannot get the CurrentFont portion to work correctly, but the script doesn't throw any errors. The font that's shown is just the font selected in Layout, not what the script calls for.

    Ultimately, what I want is to be able to enter "1" in a text field and it changes the font.

    Any help is greatly appreciated.

    Link to a screenshot of the script:

    http://imgur.com/a/8KRu8

    Running XPression Designer 6.0 build 3318


  • 2.  RE: Font Selector

    Posted 08-26-2015 01:45
    Nothing obvious stands out as being incorrect.. Could you send a dropbox link to the scene (import it into an empty project so it is smaller to send)?

    #XPression


  • 3.  RE: Font Selector

    Posted 08-26-2015 01:47
    There are other ways of doing this to which might be easier like prepending a font tag to the text such as something like this:

    `Title.TextWithTags = "{FS_Title_Home}" + Title.Text`

    Doing it this way would not require the CurrentFont property or to clear and append text to it.. Would probably make the script smaller. The way you are doing it though should work fine, so there is probably just some small typo.. I'm usually pretty quick at finding them once I have the scene itself..

    #XPression


  • 4.  RE: Font Selector

    Posted 08-26-2015 02:00
    That works perfectly, thank you!

    #XPression


  • 5.  RE: Font Selector

    Posted 08-26-2015 02:17
    I just thought of what could be wrong in your original script.. You might need to reverse the order of the lines where you set the .CurrentFont then set `.Text=""`. You probably need to clear the text first, then set the CurrentFont. If you set the CurrentFont first, then set `.Text=""` it may actually be causing the font you choose to be undone and revert back to the layout font. Glad to hear the TextWithTags works for you though.

    #XPression


  • 6.  RE: Font Selector

    Posted 08-26-2015 19:15
    Yes sir, that also fixed it.

    Thank you for your prompt response.

    Rob

    #XPression