目录

时间动画<TimeAnimation>

动效概述

时间元素刷新,当有用到time全局变量,会启动变量的刷新,time的值会按帧率进行刷新。

XML规范

<Text x="" y="" align="" color="" size="" format="time:%d" paras="#time"/>

或

<Text x="" y="" size="" color="" text="#time"/>

参 数

类 型

选 项

注 释

time

数值

必填

[0-~],当前系统时间几小时几点,设置系统全局变量time,不小于0。

效果和脚本展示

<?xml version="1.0" encoding="utf-8"?>
<Lockscreen version="1" screenWidth="1080" frameRate="30" vibrate="false" displayDesktop="true">

<!--设置秒钟动每秒动6度-->
<Var name="t1" expression="#time/1000*6"/>
<Var name="m_angle" expression="#minute*6" threshold="6"/>

<!--背景图片-->
<Image x="0" y="0" src="bg.png"/>
<!--分针-->
<Image x="529" y="545" centerX="15" centerY="198" src="fen.png" angle="#m_angle"/>
<!--秒针-->
<Image x="532" y="525" centerX="11" centerY="224" src="miao.png" angle="#t1"/>
<!--时针-->
<Image x="503" y="611" centerX="41" centerY="150" src="shi.png"  angle="#hour12*30+#minute/2"/>

</Lockscreen>