Community Forum

rendering text into a square

Forum Overview >> Scripting

CategoryScripting
Created04.01.2011 11:57


Simon Broggi (Unknown) 04.01.2011 12:05
Hello
I am trying to create some kind of text box gui element. It should render text into a square. Horizontally this works fine with the setTextWrapWidth function and the alignment values. But I have no clue how to determine the vertical space that the wraped text uses. Is there a way to get this value? Maybe it would be nice if the render Text function would return the occupied space used for the text.
Greetings, Simon

Stefan Geiger - GIANTS Software 04.01.2011 17:44
The line height currently is hardcoded as 1.1*fontSize.

In the latest SDK 4.1.7 there is a function getTextHeight(fontSize, text) which returns the height of the text using the current text wrap width.

Simon Broggi (Unknown) 04.01.2011 19:00
great, thanks!


Note: Log in to post. Create a new account here.