textbox.textHeight erratic when textbox position changes

Bugs will be moved here once resolved.

Post » Sun May 04, 2014 1:15 pm

Problem Description
Textbox textHeight and textWidth don't take work well when textbox is out of the boundaries of the project.

Attach a Capx
https://www.dropbox.com/s/fiegbhqxsrxq2 ... eport.capx

Description of Capx
A simple capx. with as little as possible elements to simulate what happens into my larger project when I try to determine textHeight and textWidth out of the screen (when the textbox itself is out of the screen, or further away)

Steps to Reproduce Bug
  • Press "Push Me" a few times
  • Drag the textbox to a lower region
  • Press "Push Me" a few times again
  • Drag the textbox to a higher region
  • Press "Push Me" a few times again

Observed Result
The red line jumps erratically, like it doesn't know textHeight or textWidth. I can't use anything else, other than textHeight&textWidth since the text in my game changes dynamically and the red line needs to go under the text ,where it actually has text.

Note that there is a delay of 0.1 for the new textHeigh&textWidth to be calculated

Expected Result
The red line is always placed below the newly sized textbox, no matter if the textbox is near the top, out of bounds or middle.

Affected Browsers
  • Chrome: (YES)
  • CocoonJS: (YES)

Operating System and Service Pack
Windows 7 SP3

Construct 2 Version ID
Release 165

THANK YOU
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Wed May 07, 2014 12:53 pm

Same here experienceing
B
1
Posts: 6
Reputation: 139

Post » Wed May 07, 2014 6:57 pm

I would love to get any feedback or maybe a solution to this since it's essential for a bigger project I'm working on. I have alternatives, of course, but if this is solved, it would help a lot.
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Thu May 08, 2014 3:04 pm

Closing, see the Text object manual entry for these expressions:

Return the size of the actual text content within the text object's rectangle. Note the Text object must be drawn before these have the correct values. If you set the text then immediately access these expressions, they won't yet have the correct value. Adding a 'Wait 0.1 seconds' action will usually solve this.


If you move the object offscreen, it is not drawn, so the values are not known. Please also only make bug reports using the latest version of Construct 2 (currently r168).
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Fri May 09, 2014 8:41 am

Observed Result
Note that there is a delay of 0.1 for the new textHeigh&textWidth to be calculated


So the project DOES have a delay, and is within bounds, bug is still present.
The bug is present no matter if it's out of bounds, or near bounds. Please test the project out, the problem will appear obvious soon after.

For future bug posts, I will use latest version.
Thank you
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Fri May 09, 2014 9:22 am

UPDATE: Just checked it with latest Construct 2, the bug is still present.
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Fri May 09, 2014 10:57 am

Your bug report description includes "when the textbox itself is out of the screen, or further away", meaning the text dimensions are not known. I cannot reproduce any problem while the text object is on-screen.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Fri May 09, 2014 8:41 pm

It's a misnomer, I apologize. Moving it within screen has the same result. Press the button many times while at a higher position, then lower the whole text to a lower one, press it again more times. The new position is not along with the textbox like at the beginning, indicating that changing of X,Y position of textbox influences text.height or width return


----Correction. I simply didn't enter textbox.x and y
It was only a wave of massive retardation on my part. Fixed it now. :) ----

sorry bout that
B
37
S
6
G
1
Posts: 301
Reputation: 2,860


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests