<!-- 上滑解锁 -->
<Unlocker name=”unlocker” alwaysShow=”true” bounceInitSpeed=”2000” bounceAccelation=”1500” >
<StartPoint x=”0” y=”0” w=”#screen_width” h=”#screen_height”>
<NormalState></NormalState>
</StartPoint>
<EndPoint x=”0” y=”-#screen_height-300” 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>
<!-- 下滑解锁 -->
<Unlocker name=”unlocker” alwaysShow=”true” bounceInitSpeed=”2000” bounceAccelation=”1500” >
<StartPoint x=”0” y=”0” w=”#screen_width” h=”#screen_height”>
<NormalState></NormalState>
</StartPoint>
<EndPoint x=”0” y=”300” 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>
<!-- 右滑解锁 -->
<Unlocker name=”unlocker” alwaysShow=”true” bounceInitSpeed=”2000” bounceAccelation=”1500” >
<StartPoint x=”0” y=”0” w=”#screen_width” h=”#screen_height”>
<NormalState></NormalState>
</StartPoint>
<EndPoint x=”300” y=”0” w=”#screen_width” h=”#screen_height”>
<Path x=”0” y=”0” tolerance=”1500”>
<Position x=”0” y=”0” />
<Position x=”#screen_width” y=”0” />
</Path>
</EndPoint>
</Unlocker>
<!-- 左滑解锁 -->
<Unlocker name=”unlocker” alwaysShow=”true” bounceInitSpeed=”2000” bounceAccelation=”1500” >
<StartPoint x=”0” y=”0” w=”#screen_width” h=”#screen_height”>
<NormalState></NormalState>
</StartPoint>
<EndPoint x=”-#screen_width-300” y=”0” w=”#screen_width” h=”#screen_height”>
<Path x=”0” y=”0” tolerance=”1500”>
<Position x=”0” y=”0” />
<Position x=”-#screen_width” y=”0” />
</Path>
</EndPoint>
</Unlocker>
<!-- 任意滑动解锁 -->
<Var name=”unlock_dist” expression=”240” const=”true” />
设置滑动距离
<Var name=”move_dx” expression=”(#touch_x-#touch_begin_x)” const=”false” />
滑块x移动距离
<Var name=”move_dy” expression=”(#touch_y-#touch_begin_y)” const=”false”/>
滑块y移动距离
<Var name=”move_radius” expression=”sqrt(#move_dx*#move_dx+#move_dy*#move_dy)” const=”false” />
滑块移动距离
下面是滑动解锁代码,满足滑动距离条件解锁
<Unlocker name=”unlocker” alwaysShow=”true”>
<StartPoint x=”#touch_begin_x” y=”#touch_begin_y” w=”1” h=”1”></StartPoint>
<EndPoint x=”ifelse(ge(#move_radius,#unlock_dist),#touch_x,-1)” y=”ifelse(ge(#move_radius,#unlock_dist),#touch_y,-1)” w=”1” h=”1”></EndPoint>
</Unlocker> |