SpriteKit(2) - 場景過渡動畫

 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))
    }
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容