Textheight returns 0

Bugs will be moved here once resolved.

Post » Sun Feb 09, 2014 12:38 pm

Link to .capx file (required! If link is blocked remove the http and www parts):
gaweb-studio.com/textbug.capx

Steps to reproduce:
1. Add 1 text
2. Set text to contain 1 line
3. Display textheight
4. change text using set new text with at least 2 lines
5. Display textheight again

Observed result:
for 3. and 5. returns 0

Expected result:
the textheight which will be different for step 3 and 5

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack:
windows 8

Construct 2 version:
r158.2 64bit
B
10
S
2
Posts: 67
Reputation: 690

Post » Sun Feb 09, 2014 2:20 pm

Closing as won't fix: the text object needs to be drawn before the size is available, so it cannot be retrieved immediately like you do in your project. Add 'Wait 0.1 seconds' and it works.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Mon Feb 10, 2014 6:24 am

I understand. Thanks for the tip !
B
10
S
2
Posts: 67
Reputation: 690


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 6 guests