• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    JavaScript
  • Created almost 5 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Transition effect for Cocos Creator

Transitions

This project is based on Cocos Creator 2.3.0.

Online Demo : http://2youyou2.com/transitions

image

Usage

image

  1. Add transitions node to the scene, the transitions node will make itself as a persist node.
  2. Select a transition in the Properties Panel.
  • Transitions from scene to other scene :
// Use **transitions.loadScene** instead of **cc.director.loadScene**
// cc.director.loadScene(url, this.onLoadSceneFinish.bind(this));
this.transitions.loadScene(url, 'Canvas/Main Camera', 'Canvas/Main Camera', this.onLoadSceneFinish.bind(this));
  • Transition from node to other node :
this.transitions.loadNode (fromCamera, fromRootNode, toCamera, toRootNode, onTransitionFinished)

Shaders

All shaders can be found in the folder: assets/resources/transitions/shaders

Builtin uniforms:

{
  texture: { value: white }
  texture2: { value: white }
  time: { value: 0 }
  ratio: { value: 1 }
}

Sources