egret白鹭 基于eui组件的一些动画类 抽屉效果
生活随笔
收集整理的這篇文章主要介紹了
egret白鹭 基于eui组件的一些动画类 抽屉效果
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
用到了白鷺的eui庫,以及緩動庫。
/**
?* 個人ui控件的控制動畫實現?* 1.抽屜效果 ? ?抽屜般收回元素,前提是元素要靠邊,就是要靠邊 ? 你想收回那邊,就要靠近那邊
?* 收回左邊 收回下邊 收回上邊 收回右邊 從左邊出來 從下面出來 從上面出來 從右邊出來
?*/
class myUi {
public constructor() {
}
/**
* 收回左邊
* ele 要控制的組件 ? width 要偏移的距離
*/
public static backLeft(ele,width){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {x: -width}, 100);
}
/**
* 收回下邊
* stageH 容器的高度
*/
public static backBottom(ele,stageH){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {y: stageH}, 100);
}
/**
* 收回上邊
* height 偏移的距離
*/
public static backTop(ele,height){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {y: -height}, 100);
}
/**
* 收回右邊
* stageW 容器的寬度
*/
public static backRight(ele,stageW){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {x: stageW}, 100);
}
/**
* 從左邊出來
*/
public static comeLeft(ele){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {x: 0}, 100);
}
/**
* 從下面出來
* height 偏移的距離
* stageH 容器的高度
*/
public static comeBottom(ele,stageH,height){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {y: stageH-height}, 100);
}
/**
* 從上面出來
* height 偏移的距離
*/
public static comeTop(ele){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {y: 0}, 100);
}
/**
* 從右邊出來
* width 偏移的距離
* stageW 容器的寬
*/
public static comeRight(ele,width,stageH){
var tw = egret.Tween.get( ele );
? ? ? ? tw.to( {x: stageH-width}, 100);
}
}
總結
以上是生活随笔為你收集整理的egret白鹭 基于eui组件的一些动画类 抽屉效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【复】从0到1的 selenium 爬虫
- 下一篇: 聊聊 SAP 产品 UI 上的消息显示机