How do I change the CSS of multiple buttons at once?

Get help using Construct 2

Post » Thu Jan 07, 2016 5:33 am

I can do one button at a time, but it seems like there should be some way of changing all buttons somehow?
B
51
S
14
G
4
Posts: 191
Reputation: 5,537

Post » Thu Jan 07, 2016 5:45 am

You could try throwing all of your buttons into a family and then running a For Each loop over the family when you set the CSS properties.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Thu Jan 07, 2016 9:38 am

You could also choose to use instances of the button object instead of new buttons and give them instance variables to know what button is clicked..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 3:37 am

Interesting, linkman, I'll book that in for investigation soon.

LS, I'd have to have the program spawn the buttons to do that? I'm still fairly new and prefer to see named buttons in the layout screen.

Also how would the coding work - how would the coding know a particular button is to apply the CSS change to itself, rather than, say a copy of that button that was spawned before it? Is there any 'self' reference in construct?
B
51
S
14
G
4
Posts: 191
Reputation: 5,537


Return to How do I....?

Who is online

Users browsing this forum: jatin1726, Resslx and 33 guests