License from €75 Log in
DE EN FR ES IT CZ

Display Object Text Weird Issue

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hello all,

    Have the following issue:

    I use display object texts for my main menu buttons.

    However when i switch language to e.g. French, the object texts are positioned abit lower for an unknown reason which i still cannot get!

    See images below, any ideas are welcome!


    • Image in post
    • Image in post
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 9 years ago
    Might be to do with the max height of the texts being different in French over English because of the special characters? That's the only thing I can think of. I believe it positions y on the top most pixel. x-axis position depends on the alignment you set in the game settings section.

    Anyway, just use some if queries to determine which language is set then update the object texts & position accordingly.
  4. · 9 years ago
    Thanks, I also thought that it might be an issue with the height of the french characters, but the weird thing is that after you switch back to english, the english text now is wrongly positioned also, so there is a smell of bug in the air, see below...

    I believe it positions y on the top most pixel. 
    Yes this is true, and i think that it's not the best way, it would be nice to be able to choose between top/middle/bottom position same way as we can adjust the x position (left/center/right)
    • Image in post
  5. · 9 years ago
    Did you update the object texts after changing language?
  6. · 9 years ago
    Yes, the object texts are displayed with a 'At beginning of scene' action, so they are refreshed in every load of the menu scene. After i change language in a separate menu scene, i go back to the object text menu scene with a 'Show menu scene' action part.
  7. · 9 years ago
    Hmm... sorry. No idea then.
  8. · 9 years ago
    The font changes its lineheight with the highest glyph. Â is higher than A. So you should display the highest text once then hide it again and then position your text.
  9. · 9 years ago
    The font changes its lineheight with the highest glyph. Â is higher than A. So you should display the highest text once then hide it again and then position your text.
    Thanks for the info; would it be possible to use the y-center instead of the y-top of the font for positioning? That would solve any issues i guess. Due to these line-height issues, seems that the y-top positioning is not ideal for the fonts.
  10. · 9 years ago
    Thanks for the info; would it be possible to use the y-center instead of the y-top of the font for positioning? That would solve any issues i guess. Due to these line-height issues, seems that the y-top positioning is not ideal for the fonts.

    wouldn't that mess with all the other definitions / concepts of positioning set in the engine? Everything regarding images and positions is positioned at the top-left corner as the default anchor. top-left /top-center/top-right for text alignment only makes sense here... You have the tools (lua) to reposition texts for specific purposes though:


    for i=1 , ActiveTexts.__len do
      if ActiveTexts[i].Owner == Buttons["my-displayed-object-text-object"] then
        ActiveTexts[i]:to(0,{Position= {x=50,y=150} })
      end
    end 

    x,y of course is the new position
  11. · 9 years ago
    by the way.. bitmap fonts get an overall height from the engine for all characters based on the highest character found in the bitmap "line" ... maybe thats why i never had this problem in the first place... 
  12. · 9 years ago
    Thanks Sebastian, yes i guess everything is ok with the bitmaps, it's only an issue with truetype fonts.

    Your code looks interesting also, will take a look.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?