How do I scale a box to the text inside?

Get help using Construct 2

Post » Tue Jun 13, 2017 12:44 pm

This seems to be weirdly problematic.

What I want to do is to load a string from somewhere else (uknown during edit time), display it in a Text object, and then scale a background sprite (or better a 9-patch but it's not important) so that I have a nice box filled with text.

Image

Think speech bubbles in any messaging application.

Reading the forum I came up with this:

Image
But it results in werid behaviour in which the sprite scales on a second button click instead of immediately. Larger delay than "wait 0" is undesirable because it doesn't look neat.

So any better ways to do this? Perhaps C3 has some new features that would facilitate measuring text?
B
16
S
7
G
1
Posts: 161
Reputation: 3,131

Post » Tue Jun 13, 2017 4:29 pm

You have to wait 0.05 seconds. It takes JavaScript about 0.01 to 0.04 seconds to resize the text.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: minigame, tannerdler, zenox98 and 6 guests