Page 1 of 2

assign color to button or shape

PostPosted: Thu Nov 17, 2011 11:38 am
by CaM
Hi,

it would be nice if I could assign a color (via its hex form) to a button or a shape within an event.

Thanks

Cameron

Re: assign color to button or shape

PostPosted: Thu Nov 24, 2011 10:25 pm
by gravy
I agree Cameron. I'd like to see that request extended to be able to change all properties of buttons and shapes via events.

I would like to set a number of button and/or shape elements (especially opacity) so i could mimic an Insteon lights dim level.

Re: assign color to button or shape

PostPosted: Sun Nov 27, 2011 5:29 am
by PiDD
yeah that would be perfect.. to be able to set a color or change a graphic by what the insteon light level is would be the pro level touch I am looking for.

Re: assign color to button or shape

PostPosted: Mon Nov 28, 2011 7:53 pm
by gravy
I had actually submitted this as a Mantis request too. Request 938.

Hopefully Steven or Wes can chime in with their thoughts on how hard this would be to implement? I think it has real value.

Re: assign color to button or shape

PostPosted: Tue Nov 29, 2011 12:10 am
by wesblack
Going over this with Steven again....will advise....! :)

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 4:28 pm
by stevenhanna6
xlobby->"button set opacity" command in latest bleeding edge

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 5:01 pm
by gravy
Wonderful, thanks Steven!

I kind of hijacked CaM's request to set color via an event though. Is that possible to implement as well?

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 5:35 pm
by stevenhanna6
Shapes have a color value, but buttons don't. You can change the button image already there is a command for that, I could add a command to shape the color of a shape if that's what you want.

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 6:52 pm
by PiDD
Thanks Steven,

Im playing with this now.

I added a circle graphic, a button and text box all with an ID = 'test opacity' and I made them yellow. (just to see what ones the effect will happen on)
I created a couple buttons.. one to set the opacity for 'test opacity' to 20 the other to 222.

When I try both buttons nothing happens?

What am I doing wrong?

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 9:41 pm
by stevenhanna6
you have to use a percentage like 5% or 70% or a variable, new build now shows that.

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 10:01 pm
by gravy
stevenhanna6 wrote:Shapes have a color value, but buttons don't. You can change the button image already there is a command for that, I could add a command to shape the color of a shape if that's what you want.


Yes, please! I could make good use of this function too.

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 10:53 pm
by wesblack
Example showing 7 Buttons that have individual events to set the bulbs opacity value. The menu has a light bulb image thats not illuminated, another image of the same bulb overlayed on top with the exact same x,y coordinates that using the Button Set Opacity event.

Sample Video+Screenshots

Video

[ Play Quicktime file ] xLobby Button Set Opacity Event.mp4 [ 348.71 KiB | Viewed 14279 times ]



Button Set Opacity Screenshot 1.jpg

Button Opacity Test Menu Screenshot 1

Button Set Opacity Screenshot 2.jpg

Button Opacity Test Menu Screenshot 2, skin editor showing the Button Set Opacity event.

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 10:56 pm
by PiDD
Works great! This is too cool!

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 11:14 pm
by PiDD
Can I tie the opacity level parameter in the event to the slider value variable?

So if my slider variable is %variable>xdimlevel% can I use that for my opacity? I think the answer will be yes but its not working for some reason??

Re: assign color to button or shape

PostPosted: Thu Dec 01, 2011 11:20 pm
by PiDD
arg sorry guys... just to answer my own question... yes, just add a % at the end. %variable>xdimlevel%

Thats twice that little % got me

Can I pass the button id of the button I mouse click to the button id parameter for the opacity command?