asia 发表于 2010-10-20 19:11:01

利用动态变量制作按钮效果的一种方法

下载过很多播放器之类的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了

惢。訫 发表于 2010-10-20 19:57:41

很好的教程。。希望出更多的教程。。

汪晨 发表于 2010-10-20 21:01:50

顶了。。。

313981329 发表于 2010-10-20 23:27:55

这个是技术贴,顶起

用身体来爱你 发表于 2010-12-1 23:51:53

好东西 。 我顶你

低调First 发表于 2010-12-8 15:15:07

顶一下楼主

zhibin 发表于 2010-12-12 15:12:58

不会,真麻烦

a5164791 发表于 2011-1-14 22:54:32

学习了。多谢楼主

rui041220103 发表于 2011-1-21 08:22:38

很有用 谢谢Lz

Ejgwg0629 发表于 2012-6-22 19:03:51

有点麻烦,
记下来
页: [1] 2 3 4
查看完整版本: 利用动态变量制作按钮效果的一种方法