Make Auto Height Of TextBox

Get help using Construct 2

Post » Sun May 29, 2016 3:32 am

Hello, i want to know how to make auto new line if max character on line if full (break line box). and the box auto set height itself, follow the new line. look the image bellow to understand what i mean.
Image

1. default height textbox (typing with space)
2. the height textbox automatic set to 2 line of text area (typing without space)
3. max height of textbox with 5 line (make auto line if the character max fill to row)

so, how to make textbox like it? because i can't make with official plugin. please help me and im sorry for my bad english
B
12
S
5
G
2
Posts: 10
Reputation: 1,962

Post » Mon May 30, 2016 4:59 am

Bumb
B
12
S
5
G
2
Posts: 10
Reputation: 1,962

Post » Tue May 31, 2016 4:20 am

Bumb...
B
12
S
5
G
2
Posts: 10
Reputation: 1,962

Post » Wed Jun 01, 2016 4:54 am

Please help...
B
12
S
5
G
2
Posts: 10
Reputation: 1,962

Post » Thu Jun 02, 2016 7:34 am

Help me
B
12
S
5
G
2
Posts: 10
Reputation: 1,962

Post » Fri Jul 22, 2016 12:35 pm

Hello @oko4,

this 'problem' is very simple to fix:
1. write the new text in the text-object
2. wait 0,1 second (is a system action)
... the Wait-action is required because the text must rendered to get the 'new' size
3. text-object: set size to: width= Text.TextWidth + 10; height: Text.TextHeight + 10 (Text.TextHeight not Text.Height)
... if you don't add few pixels (in my code 10 pixels) it is possible that the objects height is not sufficient to display the second line

I wanted to add a project file for testing, but i don't see a button for it. But I hope you can still fix your problem.
B
5
S
1
Posts: 24
Reputation: 423


Return to How do I....?

Who is online

Users browsing this forum: max2612 and 5 guests