Expresing Button1 by String+Value("Button"&Number)

Get help using Construct 2

Post » Mon Jul 01, 2013 4:58 pm

Hello.

I was wondering if anyone has a suggestion on how to do this.

For example you have 10 Button objects, all named Button1, Button2, Button3, etc.

Is it possible to refer to them in the construct 2 events by using a string and a value?

For example

value = 5
Every Tick -> Set currentButtonX to "Button"&value.X

"Button"&value.X is supposed to refer to Button5.

Is there any way to do this in Construct?
Xionor2013-07-01 16:59:05
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Mon Jul 01, 2013 5:13 pm

There is a nickname plugin that could probably do what you want. Easier solution would be to have one button object with multiple animations and differentiate button types by that. That is how I usually handle button stuff :)
B
24
S
9
G
7
Posts: 756
Reputation: 7,312


Return to How do I....?

Who is online

Users browsing this forum: jezjones24 and 20 guests