Recently in the Network Programming (java-c#), so suddenly to Cocos2d.x have an idea, bought the Jong Dirong "Coco2d-x 3.x game development Tour", feel good ~
So just record your study notes here.
(PASS: The development environment has been equipped, but I do not know why cocos2d in VS2015 is not available, had to make a virtual machine installation VS2012 play on the virtual machine ~ Fortunately, good computer ~)
1. Scene SWITCH: Director: Directing Class
Example: Loading the first scene: Runwithscene
Director::getinstance ()->runwithscene (scene);
2. Simple switching scenario: Replacescene
Director::getinstance ()->replacescene (scene);
3.menuCloseCallback: Is the callback function of the Close button ~ (the book says it will speak later ~)
4.TransitionSlideInT: Scene Class (for animated effects Oh ~)
Transitionslideint (float t, Scene *scene);
There are other, of course:
Transitionjumpzoom: Original scene Zoom out, new scene zoom in
TRANSITIONPROGRESSRADIALCCW: Switch counterclockwise
Transitionprogresshorizontal: Horizontal pointer Toggle
Transitionprogressinout: Switching from inside to outside
Transitioncrossfade: The original scene slowly disappears, the new scene also slowly appears
Transitiopageforward: page, Next;
TRANSITIONFADETR: Block toggle lower left corner
Transitionfadeup: The blinds from the bottom up
Transitionturnofftiles: block switch, everywhere
Transitionsplitrows: Separated rectangular cross-shift
Transitionfade: Fades (turns black), gradients appear
Flipxleftover: Overall horizontal rollover, from left to right
Zoomflipxleftover: Overall horizontal rollover, from left to right, and scaled by distance from field of view
Transitionshrinkgrow: The original scene is shrinking back, the new scene from the rear to appear
Transitionrotozoom: The original scene spiral back to shrink away, new scene spiral forward to enlarge the appearance
TRANSITIONMOVEINL: New scene moves from left to right into
TRANSITIONSLIDEINL: Old and new scenes move from left to right at the same time
5. The scene's propulsion and popup scene:
The above Replacescene function makes the scene switch, which causes the old scene to be freed (because a scenario in development may take up a lot of resources)
But this approach does not need to release the old scene, the old and new scenes are still stored in memory
For example: Pushsene function: the
Popscene function: Release the new scene, restore the old scene display
1 //HelloWorldScene.cpp Part2 voidHelloworld::menuclosecallback (ref*Psender)3 {4 //Advancing the scene5Director::getinstance ()Pushscene (Secondscene::createscene ());6 }7 8 //SenondScene.cpp Part9 BOOLSecondscene::init () {Tenlabel* label = Label::create ("Hi, is you Mutou?","Arial", +); OneLabel->setposition (CCP ( $, $)); A This-addChild (label); - /*Add button*/ -Menuitemimage *pcloseitem =Menuitemimage::create ( the "Closenormal.png", - "Closeselected.png", - This, - menu_selector (secondscene::p opscene)); +Pcloseitem->setposition (CCP (Director::getinstance ()->getwinsize (). Width- -, -)); - +menu* Pmenu =menu::create (Pcloseitem, NULL); APmenu->setposition (Point (0,0)); at This->addchild (Pmenu,1); - return true; -}
< Span id= "line59" >< Span class= "Start-tag" > < Span class= "Attribute-name" >
Cocos2d-x 3.x Learning (1)