how i can set a background to my text

Get help using Construct 2

Post » Tue May 13, 2014 7:58 pm

i have deferent texts and a background, and i want to set this background for my texts.
but my question is how can i do to get this background sets automaticly when the text changes width an height

thanks!
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 26
Reputation: 307

Post » Tue May 13, 2014 11:16 pm

fattah wrote:i have deferent texts and a background, and i want to set this background for my texts.
but my question is how can i do to get this background sets automaticly when the text changes width an height

thanks!
B
5
Posts: 26
Reputation: 307

Post » Wed May 14, 2014 10:10 am

You can set the background size to Text.TextWidth, Text.TextHeight + some border. The only problem is that the TextWidth/Height doesn't update immediately when you change the text so you need some delay.

You might keep track of the old values in instance variables so you can detect when it has changed and update the background size accordingly.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680

Post » Wed May 14, 2014 10:25 am

Hey Ramones Thanks four your answer.

there is any example ??
B
5
Posts: 26
Reputation: 307

Post » Wed May 14, 2014 11:41 am

Here's an example with one text object:

textBackground.capx
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests