It is currently April 28th, 2024, 12:28 am
Get help with creating, editing & fixing problems with skins
ElderGoose
Posts: 16 Joined: August 15th, 2012, 11:55 pm
Post
by ElderGoose » August 15th, 2012, 11:59 pm
Hello,
I'm trying to make an image change its tint when I double click it, however, I can't seem to get it to work. Here's what I have:
Code: Select all
[MeterImage]
Meter=IMAGE
ImageName=C:\Users\image.png
X=15
Y=0
H=50
ImageTint=0,0,0,255
LeftMouseDoubleClickAction=!SetVariable "ImageTint" "0,0,0,100"
Any Suggestions?
Kaelri
Developer
Posts: 1721 Joined: July 25th, 2009, 4:47 am
Post
by Kaelri » August 16th, 2012, 12:17 am
"ImageTint" is not a variable. What you want to do is change the ImageTint option on the meter. For that, use:
Code: Select all
LeftMouseDoubleClickAction=!SetOption "MeterImage" "ImageTint" "0,0,0,100"
(More information
here .)
ElderGoose
Posts: 16 Joined: August 15th, 2012, 11:55 pm
Post
by ElderGoose » August 16th, 2012, 12:39 am
How then, could I decrement the alpha value each time I double click on it?
Kaelri
Developer
Posts: 1721 Joined: July 25th, 2009, 4:47 am
Post
by Kaelri » August 16th, 2012, 1:55 am
Ah, for that, you
would use a variable. :) You can use mathematical formulas in many contexts, including bang commands, by enclosing them in parentheses. Example:
Code: Select all
[Variables]
MyVariable=255
...
[MeterImage]
Meter=IMAGE
ImageName=C:\Users\image.png
X=15
Y=0
H=50
ImageTint=0,0,0,#MyVariable#
LeftMouseDoubleClickAction=!SetVariable "MyVariable" "(#MyVariable#-20)"
DynamicVariables=1
Make sure that dynamic variables are enabled on the meter, so that it will respond when the variable changes.
ElderGoose
Posts: 16 Joined: August 15th, 2012, 11:55 pm
Post
by ElderGoose » August 16th, 2012, 3:31 am
Awesome, thanks!