TextRestrainedInside - is the static textbox enough big?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

TextRestrainedInside - is the static textbox enough big?

Post by ibax »

Hello,

I would like to check if the text which I put into a static text box, fits into the box area or not.
Something similar like the 'isTextRestrainedInside()' function, but if I understood good, it returns the value of the 'setTextRestrainedInside()' parameter of a static text.

But how to check, whether the static text box is enough big or not?

Why do I need this? There are so many possible resolutions available by a graphic card, but the font size can be selected by the user. It can occur, that in one resolution the static text box is enough big, but in a smaller resolution some words goes outside the static text box area. I would like to solve this somehow...

Thanks...
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TextRestrainedInside - is the static textbox enough big?

Post by CuteAlien »

IGUIFont::getDimension should at least give you the dimensions for the text-string. Thought not sure if it works well with line-breaks.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply