Why textHeight not working?

Get help using Construct 2

Post » Wed Feb 08, 2012 1:13 pm

B
25
S
7
G
3
Posts: 32
Reputation: 2,868

Post » Wed Feb 08, 2012 1:43 pm

The text gets actually updated the tick after the action happened.
So as you noticed, you can only get the textheight a tick after a new text is updated in a text object.

I guess it has to do with the fact that the text object is handled out of the canvas in a separate layer.
it's not a "true"/belonging part of your application.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Feb 08, 2012 5:28 pm

Yeah, this is a quirk which is very difficult to work around, because the Text object does not know its dimensions until the next time it is drawn. It's not drawn until the current run of events finished. 0.1 seconds later (after about 6 ticks) it's been drawn again so it knows its size.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 5 guests