cocos2d-x-3.x scene (3) Scene Toggle Effects

Source: Internet
Author: User

I heard that the Cocos scene switch more handsome, on the internet to check a lot of scenes can be switched off.

First say how to do, paste code, in the place shown in the previous section

BOOL Helloworld::init ()
{

if (! Layer::init ())
{
return false;
}

Size visiblesize = director::getinstance ()->getvisiblesize ();
VEC2 origin = Director::getinstance ()->getvisibleorigin ();

Sprite *label = sprite::create ("0842.png");
Label->setposition (VISIBLESIZE.WIDTH/2, VISIBLESIZE.HEIGHT/2);
AddChild (label);
Label->setposition (VISIBLESIZE.WIDTH/2, VISIBLESIZE.HEIGHT/2);
Eventlistenertouchonebyone *listener = Eventlistenertouchonebyone::create ();
Listener->ontouchbegan = [Label] (Touch *t, Event *e) {
if (Label->getboundingbox (). Containspoint (T->getlocation ())) {
Director::getinstance ()->replacescene (transitionzoomflipx:: Create//See here!!! The rest is the same, where the red places are replaced with individual effects.
(1,imagescene::createscene ()));
}
return false;
};
Director::getinstance ()->geteventdispatcher ()
Addeventlistenerwithscenegraphpriority (listener, label);

return true;
}

Find some code to replace the scene on the internet

Cctransitionjumpzoom
Action: Create a bouncing transition animation
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionjumpzoom:: Create (T, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionprogressradialccw
Action: Creates a transition animation in a sector bar form, counterclockwise
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogressradialccw::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionprogressradialcw
Action: Creates a transition animation in a fan-shaped bar form, clockwise direction
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogressradialcw::create (t,s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionprogresshorizontal
Effect: Creates a transition animation in the form of a horizontal bar,
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogresshorizontal:: Create (T,s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionprogressvertical
Effect: Creates a transition animation in a vertical bar form,
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogressvertical::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);


Cctransitionprogressinout
Action: Creates a transition animation that expands from the inside Out,
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogressinout::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionprogressoutin
Role: Create a transition animation that extends outward,
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitionprogressoutin::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitioncrossfade
Action: Create a gradual, transparent transition animation
Parameter 1: Time of the transition action
Parameter 2: Object switching to the target scene
Rescene = Cctransitioncrossfade::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionpageturn
Action: Create a Transition animation for page flipping
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Reverse paging
Rescene = Cctransitionpageturn::create (t, S, false);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionfadetr
Action: Create a blog transition animation, from bottom left to top right
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene =cctransitionfadetr::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionfadebl
Action: Create a blog transition animation, from top right to bottom left
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionfadebl::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionfadeup
Action: Creates a transition animation from bottom to top, bar folding
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene= cctransitionfadeup::create (t, s);
Ccdirector::shareddirector ()->replacescene (s);

Cctransitionfadedown
Action: Creates a transition animation from top to bottom, bar folding
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionfadedown::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

//Cctransitionturnofftiles
//function: Create a transition animation that disappears from a random square
//Parameter 1: Duration of Transition action
//Parameter 2: Toggle object for Target scene
//rescene= Cctransitionturnofftiles::create (t, s);
//Ccdirector::shareddirector ()->replacescene (Rescene);

//cctransitionsplitrows
//role: Create a split transition animation for a branch break
//Parameter 1: Duration of the transition action
//Parameter 2: Toggle object for Target scene
//Rescene = Cctransitionsplitrows::create (t, s);
//Ccdirector::shareddirector ()->replacescene (rescene);

///Cctransitionsplitcols
//role: Create a split transition animation with a column break
//Parameter 1: Duration of Transition action
//Parameter 2: Toggle object for Target scene
//Rescene = Cctransitionsplitcols::create (t, s);
//Ccdirector::shareddirector ()->replacescene (Rescene);

//Cctransitionfade
//action: Create a transition animation that gradually transitions to the target color
//Parameter 1: Duration of the transition action
//Parameter 2: Toggle object for Target scene
//Parameter 3: Target color
Rescene= cctransitionfade::create (t, S, CCC3 (255, 0, 0));
//Ccdirector::shareddirector ()->replacescene (Rescene);

//CCTRANSITIONFLIPX
//action: Create a toggle animation with x-axis reversal
//Parameter 1: Duration of the transition action
//Parameter 2: Object of the target scene to toggle
//Parameter 3: Invert type enum variable Left and right
//korientationdownover korientationleftover korientationrightover korientationupover
//ReScene = Cctransitionflipx::create (t, S, korientationrightover);
//Ccdirector::shareddirector ()->replacescene (rescene);

Cctransitionflipy
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Inverse enumeration of type variables left and right
Rescene = Cctransitionflipy::create (T, s
, Korientationdownover);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionflipangular
Action: Create a toggle animation with reverse rotation
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Inverse enumeration of type variables left and right
Rescene = Cctransitionflipangular::create (t, S, korientationleftover);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionzoomflipx
Action: Creates an animation with a scaled x-axis reversal Toggle
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Inverse enumeration of type variables left and right
Rescene=cctransitionzoomflipx::create (t, S, korientationleftover);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionzoomflipy
Action: Creates an animation with a scaled y-axis reversal Toggle
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Inverse enumeration of type variables left and right
Rescene=cctransitionzoomflipy::create (t, S, korientationdownover);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionzoomflipangular
Action: Create an animation with zoom, reverse corner Toggle
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Parameter 3: Inverse enumeration of type variables left and right
Rescene=cctransitionzoomflipangular::create (t, S, korientationrightover);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionshrinkgrow
Create a transition animation that shrinks alternately
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionshrinkgrow::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionrotozoom
Create a transition animation that rotates and shrinks alternately
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionrotozoom::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionmoveinl
Action: Creates a transition animation that pushes the overlay from the left
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionmoveinl::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionmoveinr
Action: Creates a transition animation that pushes the overlay from the right
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionmoveinr::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionmoveinb
Action: Create a transition animation that pushes the overlay from the bottom
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionmoveinb::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionmoveint
Action: Creates a transition animation that pushes the overlay from the top
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene = Cctransitionmoveint::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionslideinl
Action: Create a transition animation that pushes from the left and tops the old scene
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene =cctransitionslideinl::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionslideinr
Action: Create a transition animation that pushes from the right and tops the old scene
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene =cctransitionslideinr::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);


Cctransitionslideint
Action: Create a transition animation that pushes from the top and tops the old scene
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene
Rescene =cctransitionslideint::create (t, s);
Ccdirector::shareddirector ()->replacescene (Rescene);

Cctransitionslideinb
Action: Create a transition animation that pushes from the bottom and tops out the old scene
Parameter 1: Duration of the transition action
Parameter 2: Toggle the object of the target scene

cocos2d-x-3.x scene (3) Scene Toggle Effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.