Adding text objects (button texts, popup texts, info texts) to menus (or scenes)

  • #10, by LebosteinFriday, 15. May 2015, 16:37 9 years ago
    "Display object text" and "Hide object text" works with menu scene objects too! I have tested it. My dreams would come true if I could select the object text font for every object separately. Then it would be possible to build very nice language dependent text buttons with highlightning (and without special LUA things). Instead of the object image for the button text and the highlighted button text you could add object texts (with normal and highlighted fonts) to the scene objects at the beginning of the scene. That would be a very nice improvement. This would be downward compatible too. Then if no local object text font is selected, the standard object text font (GameObjectFont) could be used.

    Key Killer

    621 Posts


  • #11, by AlexFriday, 15. May 2015, 17:29 9 years ago
    An own font for the object text would indeed be very nice. The problem is that the data structure for action parts only allows for 2 linked objects which are already in use (text and object). I don't want to add another link just for this action part because there can be a lot of action parts. That's why we use the standard object text font. A solution could be to add the font to the object properties.

    And don't forget to hide the object text when leaving a scene and the text is no longer visible - internally the text is kept otherwise.

    Great Poster

    378 Posts

  • #12, by LebosteinFriday, 15. May 2015, 18:42 9 years ago
    A solution could be to add the font to the object properties.

    That is what I thought. And if this property is empty ([default]) the standard object text font is used (so as before - for the backward compatibility).

    Key Killer

    621 Posts

  • #13, by LebosteinSaturday, 23. May 2015, 10:45 9 years ago
    I found out that it's possible to use different fonts for different objects! You have to change the font, before you set the text:

    1) Execute script: game.ObjectFont = Fonts["font1"]
    2) Display text for 'object1'
    3) Execute script: game.ObjectFont = Fonts["font2"]
    4) Display text for 'object2'
    ... and so on

    I use such sequences above in the "at beginning of scene" action to fill my menus with language dependent texts. Very nice and useful!

    Key Killer

    621 Posts

  • #14, by AlexSaturday, 23. May 2015, 11:44 9 years ago
    you're right. So I guess we don't need an own object font for each scene object? I assume there are usually not that many object texts in a game anyway. Would an action part to change the object font be useful?

    Great Poster

    378 Posts

  • #15, by afrlmeSaturday, 23. May 2015, 15:23 9 years ago
    The ability to link a font to an object & specify which font to use could be useful for various things I believe.

    Is it not possible to update the display object text action part to be able to specify which font to use for it like you can do with the narration text action part?

    If you can do that with object text fonts & they can be shown on both menu scenes & playable scenes then there is no reason to create font sections for scene objects.

    Imperator

    7278 Posts

  • #16, by LebosteinSaturday, 23. May 2015, 16:36 9 years ago
    @AFRLme: The narration text action part has a field for setting the font! But the narration text is not useful for static scene texts because:
    1. there is no possibility to show a narration text permanently (it is a short "talking" output)
    2. there is no align option for narration texts
    3. there is no parent object to hide, show, move or fade in/out the text

    All these advantages you can have with object texts. But the problem here is the font. There is no font field because all linked objects in that action part are used... but possible with a LUA workaround (see above) for example

    Key Killer

    621 Posts

  • #17, by afrlmeSaturday, 23. May 2015, 17:14 9 years ago
    I was more talking to Alex. Well musing as to whether or not it would be possible to add a parameter to the object texts for defining the font for the object text & whether or not it would be possible to use object texts on both menu & playable scenes.

    As for what you said about narration texts. You are right that there is no simple method for displaying a narration text permanently but, it is possible by creating a loop using the jump to x action part.
    display narration text 'some text...' for x ms (background text)
    pause for x ms - 10ms
    jump to action part #1
    

    This would work in same way as object text, except you are using a loop to make sure text is constantly displayed. You would have to manually kill the loop at end of scene by quitting the action containing the text. Also because text is in a loop, it would display the new text based on current language on next loop.

    Imperator

    7278 Posts