MAML教程,任意屏幕的滑动

任意屏幕滑动的实例
点击下载完整DEMO
多屏滑动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="utf-8"?>
<Lockscreen version="1" frameRate="60" displayDesktop="false" screenWidth="1080">
	<!-- 设定屏幕数量 -->
	<Var name="ScreenNumber" expression="26" />
	<!-- 多屏划动切换控制动画 -->
	<Var name="Move" expression="(#touch_x-#touch_begin_x)*#Move_flag+#MoveGo" />
	<Var name="MoveGo">
		<VariableAnimation initPause="true" loop="false">
			<AniFrame value="#Move1" time="0" easeType="QuintEaseOut" />
			<AniFrame value="#Move2" time="600" />
		</VariableAnimation>
	</Var>
	<!-- 滑屏按钮 -->
	<Button x="0" y="120" w="1080" h="1800">
		<Triggers>
			<Trigger action="down">
				<VariableCommand name="Move_flag" expression="1" />
			</Trigger>
			<Trigger action="up,cancel">
				<VariableCommand name="Move_flag" expression="0" />
				<VariableCommand name="Move1" expression="#Move2+#touch_x-#touch_begin_x" />
				<VariableCommand name="Move2" expression="ifelse(gt(abs(#touch_x-#touch_begin_x),300),max(min(#Move2+ifelse(gt(#touch_x,#touch_begin_x),1,-1)*1080,0),-1080*(#ScreenNumber-1)),#Move2)" />
				<Command target="MoveGo.animation" value="play" />
			</Trigger>
		</Triggers>
	</Button>
	<!-- 数组类型图片排列,count的值设为跟#ScreenNumber值一样即可 -->
	<Array x="#Move" count="26" indexName="WallpaperCS" >
		<Image x="540+1080*#WallpaperCS" align="center" src="wallpaper/w.jpeg" srcid="#WallpaperCS" w="1080" h="ifelse(eq(#raw_screen_height,2040),2040,1920)" visibility="gt(#Move,-1080*(#WallpaperCS+1))*lt(#Move,-1080*(#WallpaperCS-1))" />
	</Array>
 
	<Text x="100" y="100"  color="#ffffff" size="70" textExp="int(abs(#Move/1080)+1)" />
 
	<!-- 上滑解锁 -->
	<Unlocker name="unlocker" alwaysShow="true" >
		<StartPoint x="0" y="0" w="#screen_width" h="#screen_height" easeType="BounceEaseOut" easeTime="800"/>
		<EndPoint x="0" y="-#screen_height-400" w="#screen_width" h="#screen_height" >
			<Path x="0" y="0" tolerance="2000">
				<Position x="0" y="0" />
				<Position x="0" y="-#screen_height" />
			</Path>
		</EndPoint>
	</Unlocker>
</Lockscreen>

暂无评论

发表评论

电子邮件地址不会被公开。

©2015-2016 zhutidasai.com. 版权所有 京ICP备16041368号-3