func animationAll() {
let nextScene = NewGameScene(size: self.size)
//交叉淡入淡出
self.view?.presentScene(nextScene, transition: .crossFade(withDuration: 0.5))
//從左右兩邊水平關閉
self.view?.presentScene(nextScene, transition: .doorsCloseVertical(withDuration: 0.5))
//從上下兩邊垂直關閉
self.view?.presentScene(nextScene, transition: .doorsCloseHorizontal(withDuration: 0.5))
//從左右兩邊水平打開
self.view?.presentScene(nextScene, transition: .doorsOpenVertical(withDuration: 0.5))
//從上下兩邊垂直打開
self.view?.presentScene(nextScene, transition: .doorsOpenHorizontal(withDuration: 0.5))
//舊場景從中間兩邊打開,新場景從后方屏幕靠近
self.view?.presentScene(nextScene, transition: .doorway(withDuration: 0.5))
//先變成指定顏色,在變成目標場景
self.view?.presentScene(nextScene, transition: .fade(with: SKColor.blue, duration: 0.5))
//先變成黑色,在變成目標場景
self.view?.presentScene(nextScene, transition: .fade(withDuration: 0.5))
//水平翻轉
self.view?.presentScene(nextScene, transition: .flipVertical(withDuration: 0.5))
//垂直翻轉
self.view?.presentScene(nextScene, transition: .flipHorizontal(withDuration: 0.5))
//一個新場景從指定方向進入
self.view?.presentScene(nextScene, transition: .moveIn(with: .down, duration: 0.5))
//一個新場景從指定方向推入
self.view?.presentScene(nextScene, transition: .push(with: .down, duration: 0.5))
//一個舊場景向指定方向移除,新場景在舊場景下面
self.view?.presentScene(nextScene, transition: .reveal(with: .down, duration: 0.5))
}
SpriteKit(2) - 場景過渡動畫
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
推薦閱讀更多精彩內容
- 1.CSS3 文本效果 text-shadow屬性適用于文本陰影 box-shadow 屬性適用于盒子陰影 CSS...
- 來自于PeteC/InteractiveViewControllerTransitions的定制過渡效果,這是個人...
- “白衣秀士”王倫通常給人的印象是沒啥本事,又小肚雞腸、嫉賢妒能。當林沖火并王倫時,很多人都覺得大快人心。其實,這是...
- 題目來源計算1到10^n數字中每一個數字都是唯一的數。原來以為很復雜,需要一系列推導,沒想到結果答案那么簡單。 當...