利用动态变量制作按钮效果的一种方法
下载过很多播放器之类的Skins,发现里面用的按钮为:.
.
.
MouseOverAction=!execute [!RainmeterShowMeter PlayHight][!RainmeterRedraw]
MouseLeaveAction=!execute[!RainmetetHideMeter PlayHight][!RainmeterRedraw]
然后下面是一个Meter .....
用这样的方法需要写两个Meter,而且效果也不太好。下面介绍如何用动态变量来达到更好的效果:
我想让这个Play按钮MouseOver时变为白色,移开时又恢复为灰色。
首先在下声明:
Fcolor=25,25,25,200
Scolor=25,25,25,50
然后:
Meter=String
x=180
y=20
solidcolor=#Scolor#
FontColor=#Color#
FontSize=15
FontFace=Webdings
StringAlign=Center
AntiAlias=1
Text="4"
hidden=0
LeftMouseupAction=!execute [!RainmeterPluginBang "MeasureWA PLAY 1 "]
MouseOverAction=!execute [!RainmeterSetVariable FColor (255,255,255,250)][!RainmeterSetVariable Scolor (250,200,200,250)]
当鼠标移上时,改变变量FColor和Scolor的值并重绘
MouseLeaveAction=!execute [!RainmeterSetVariable FColor (25,25,25,200)][!RainmeterSetVariable Scolor (25,25,25,50)]
当鼠标移开时,改变变量FColor和Scolor的值并重绘
DynamicVariables=1 ;这个是在Meter中使用动态变量,=1为使用,=0为不使用,缺省为0,
OK,大家有空可以使使,还可以结合LeftMouseDown/UpAction来达到更好的效果,完全可以替代Meter=Button,当然却达不到Button变化快和美观的效果,但是不用打开PS自己去做一个Button了 很好的教程。。希望出更多的教程。。 顶了。。。 这个是技术贴,顶起 好东西 。 我顶你 顶一下楼主 不会,真麻烦 学习了。多谢楼主 很有用 谢谢Lz 有点麻烦,
记下来