合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
基础命令,有针对一个元素,例如一张图位移,也有多张图组成的帧动画,通过这些动画可以实现动画位移效果。
<Image x="" y="" centerX="" centerY="" src=""> <PositionAnimation delay="" repeat=""> <Position x="" y="" time=""/> </PositionAnimation> </Image>
| 参 数 | 类 型 | 选 项 | 注 释 |
|---|---|---|---|
| delay | 数值 | 选填 | 延迟,以ms毫秒记。延迟delay毫秒后执行动画播放。 |
| repeat | 数值 | 选填 | 动画重复播放次数,N表示重复N次,0表示无限次循环。 |
| x | 数值 | 必填 | 相对于图片初始位置的x坐标,整数。 |
| y time | 数值 数值 | 必填 必填 | 相对于图片初始位置的y坐标,整数。 [0-~],相对于起始帧的间隔时间(毫秒),不小于0。 |
<?xml version="1.0" encoding="utf-8"?>
<Lockscreen version="1" screenWidth="1080" frameRate="30" vibrate="false" displayDesktop="true">
<!--背景图片-->
<Image src="bg.png" />
<!--云朵1的位移-->
<Image src="1.png">
<PositionAnimation repeat="0">
<Position x="-1080" y="0" time="0"/>
<Position x="-900" y="0" time="1000"/>
<!--从0~1000ms坐标由(-1080,0)变为(-900,0)-->
<Position x="-600" y="0" time="2000"/>
<!--从1000~2000ms坐标由(-900,0)变为(-600,0)-->
<Position x="-300" y="0" time="3000"/>
<Position x="0" y="0" time="4000"/>
<Position x="300" y="0" time="5000"/>
<Position x="600" y="0" time="6000"/>
<Position x="900" y="0" time="7000"/>
<Position x="1200" y="0" time="8000"/>
</PositionAnimation>
</Image>
<!--云朵2的位移-->
<Image src="2.png">
<PositionAnimation repeat="0">
<Position x="-1080" y="0" time="0"/>
<Position x="-800" y="0" time="1000"/>
<Position x="-600" y="0" time="2000"/>
<Position x="-400" y="0" time="3000"/>
<Position x="-200" y="0" time="4000"/>
<Position x="0" y="0" time="5000"/>
<Position x="200" y="0" time="6000"/>
<Position x="400" y="0" time="7000"/>
<Position x="600" y="0" time="8000"/>
<Position x="800" y="0" time="9000"/>
<Position x="1000" y="0" time="10000"/>
<Position x="1200" y="0" time="12000"/>
</PositionAnimation>
</Image>
</Lockscreen>