Page 1 of 1
Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 00:02
by jbw
I have a project with a switch object, one row with twelve columns, and am looking for a way to change the color of a single switch by controlling it with a pad.
I'm hoping to set it up so that when you tap the pad it will cycle through three different colors for a specific switch, and not all twelve at once.
The only thing I've figured out so far is to set the attribute of the switch so that multiple colors show up. Yes, I am new to this.
Like I say, I'd like to be able to control the color change of just one switch, by tapping a pad that will cycle through three different colors.
Any help is appreciated!
Re: Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 01:28
by jbw
Got it so when I press a pad it changes the color of the switches. Did so by moving the "setattribute" script to the pad object rather than the switch object, and setting the script to run when the pad is pressed "On". Easy enough.
Now I just need two things:
1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Re: Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 04:30
by jbw
jbw wrote:Now I just need two things:
1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Came up with a solution for #2:
Create three separate pads, one for each color. So rather than cycling through colors with one pad, just tap one of the three to change the color.
Last thing needed:
The ability to target a specific switch, because right now it changes the color of all the 12 switches. Again, it's 1 row and 12 columns, and I want to be able to change the color of just 1 rather than all 12
Any help for this last one is appreciated! Hopefully there's a way to do this.
Re: Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 04:34
by jbw
Here's the code I have set to the 3 Pads (with the number different for each color):
Code: Select all
setattribute(Switches25,'colors',{8355711});
And for the "Switches25" I have the "Multicolor" box checked.
The answer is probably something relatively easy. I just haven't found it yet.
Re: Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 14:50
by MrCorba
I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0
Cheers!
Re: Target a single switch and change it's color with a pad?
Posted: 18 Dec 2015 20:59
by jbw
MrCorba wrote:I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0
Cheers!
Thanks!
Re: Target a single switch and change it's color with a pad?
Posted: 16 Feb 2016 18:15
by darrow
MrCorba wrote:
I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0
Link expired. Please repost.
Re: Target a single switch and change it's color with a pad?
Posted: 17 Feb 2016 21:51
by MrCorba
I actually deleted it and I didn't have it anymore so I tried to recreate it. It was something like this, maybe JBW has the original one.
Re: Target a single switch and change it's color with a pad?
Posted: 20 Feb 2016 19:55
by darrow
Thanks for the repost. Much appreciated.