效果如下:
代码如下:
<Var name="sz_rotate" expression="#hour12*30+#minute/60*30" alias="时钟变量" />
<Var name="fz_rotate" expression="#minute*6" alias="时钟变量" />
<Group x="#w/2+220" y="760">
<Image x="0" y="0" align="center" alignV="center" src="th_h.png" centerX="95" centerY="95" rotation="#sz_rotate" />
<Image x="0" y="0" align="center" alignV="center" src="th_m.png" centerX="95" centerY="95" rotation="#fz_rotate" />
<Image x="0" y="0" align="center" alignV="center" src="th_s.png" centerX="95" centerY="95" rotation="(#time/1000)%60*6" />
<Image x="-12" y="-12" src="clock_cener.png" />
</Group>
另一种方法,虽然代码量多,但有淡进淡出代码则更加优雅 :
<Image x="335" y="944" name="szdh6" align="center" alignV="center" w="230" h="230" pivotX="115" pivotY="115" src="ms2/miao.png" rotation="(#time/1000)%60*6">
<RotationAnimation>
<Rotation angle="300" time="0" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="1200" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="9999999999999"/>
</RotationAnimation>
</Image>
<Image x="335" y="944" name="szdh7" align="center" alignV="center" w="230" h="230" pivotX="115" pivotY="115" src="ms2/fen.png" rotation="#minute*6">
<RotationAnimation>
<Rotation angle="250" time="0" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="1200" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="9999999999999"/>
</RotationAnimation>
</Image>
<Image x="335" y="944" name="szdh8" align="center" alignV="center" w="230" h="230" pivotX="115" pivotY="115" src="ms2/shi.png" rotation="#hour12*30+#minute/2">
<RotationAnimation>
<Rotation angle="100" time="0" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="1200" varSpeedFlag="SineFun_InOut"/>
<Rotation angle="0" time="9999999999999"/>
</RotationAnimation>
</Image>