textbox.textHeight erratic when textbox position changes

0 favourites
  • 8 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • 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


  • Same here experienceing

  • 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.

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

    [quote:hlj4vjgk]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).

  • [quote:h9n375et]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

  • UPDATE: Just checked it with latest Construct 2, the bug is still present.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)