在scenemanager中申明乙個靜態方法
void scenemanager::runthisscene(cclayer* layer,float time)
else
}
切換場景
在scenemanager中定義靜態函式
void scenemanager::callgardenbegin()
場景中動畫切換,將scene傳進來,返回乙個新的scene
ccscene* scene2 = cctransitionfade::transitionwithduration(time, scene);
cctransitionjumpzoom::transitionwithduration(t, s);//跳躍式,本場景先會縮小,然後跳躍進來
cctransitionfade::transitionwithduration(t, s);//淡出淡入,原場景淡出,新場景淡入
cctransitionfade::transitionwithduration(t, s, ccwhite);//如果上乙個的函式,帶3個引數,則第三個引數就是淡出淡入的顏色
cctransitionflipx::transitionwithduration(t, s, korientationleftover);//x軸左翻
cctransitionflipx::transitionwithduration(t, s, korientationrightover);//x軸右翻
cctransitionflipy::transitionwithduration(t, s, korientationupover);//y軸上翻
cctransitionflipy::transitionwithduration(t, s, korientationdownover);//y軸下翻
cctransitionflipangular::transitionwithduration(t, s, korientationleftover);//有角度轉的左翻
cctransitionflipangular::transitionwithduration(t, s, korientationrightover);//有角度轉的右翻
cctransitionzoomflipx::transitionwithduration(t, s, korientationleftover);//帶縮放效果x軸左翻
cctransitionzoomflipx::transitionwithduration(t, s, korientationrightover);//帶縮放效果x軸右翻
cctransitionzoomflipy::transitionwithduration(t, s, korientationupover);//帶縮放效果y軸上翻
cctransitionzoomflipy::transitionwithduration(t, s, korientationdownover);//帶縮放效果y軸下翻
cctransitionzoomflipangular::transitionwithduration(t, s, korientationleftover);//帶縮放效果/有角度轉的左翻
cctransitionzoomflipangular::transitionwithduration(t, s, korientationrightover);//帶縮放效果有角度轉的右翻
cctransitionshrinkgrow::transitionwithduration(t, s);//交錯換
cctransitionrotozoom::transitionwithduration(t, s);//轉角換
cctransitionmoveinl::transitionwithduration(t, s);//新場景從左移入覆蓋
cctransitionmoveinr::transitionwithduration(t, s);//新場景從右移入覆蓋
cctransitionmoveint::transitionwithduration(t, s);//新場景從上移入覆蓋
cctransitionmoveinb::transitionwithduration(t, s);//新場景從下移入覆蓋
cctransitionslideinl::transitionwithduration(t, s);//場景從左移入推出原場景
cctransitionslideinr::transitionwithduration(t, s);//場景從右移入推出原場景
cctransitionslideint::transitionwithduration(t, s);//場景從上移入推出原場景
cctransitionslideinb::transitionwithduration(t, s);//場景從下移入推出原場景
以下兩個需要先設定攝像機,使用ccdirector::shareddirector()->setdepthtest(true);
cctransitionpageturn::transitionwithduration(t, s, false);//翻頁,前翻
cctransitionpageturn::transitionwithduration(t, s, true);//翻頁,後翻
cctransitionfadetr::transitionwithduration(t, s);//向右上波浪
cctransitionfadebl::transitionwithduration(t, s);//向左下波浪
cctransitionfadeup::transitionwithduration(t, s);//向上百葉窗
cctransitionfadedown::transitionwithduration(t, s);//向下百葉窗
cctransitionturnofftiles::transitionwithduration(t, s);//隨機小方塊
cctransitionsplitrows::transitionwithduration(t, s);//按行切
cctransitionsplitcols::transitionwithduration(t, s);//按列切
cocos2dx中關於場景的管理
runwithscene ccscene scene 啟動遊戲,並執行scene 場景。這個方法在主程式啟動時第一次啟動主場景時呼叫。replacescene ccscene scene 直接使用傳入的scene 替換當前場景來切換畫面,當前場景將被釋放。這是切換場景時 最常用的方法。pushsce...
Cocos2d x之場景切換
在很多rpg遊戲中大部分存在多個場景,如開始的歡迎介面 選單介面 戰鬥介面 場景切換只需要呼叫ccdirector shareddirector replacescene s s為新的場景,這句 的是含意,是用新的場景s去替換掉舊的場景,但是這樣的場景替換,來得太突然,給使用者的感覺不太好,我們需要...
cocos2dx切換場景
分享一下cocos2dx切換場景函式 場景a切換到場景b,有切換特效 呼叫順序如下 aaabababa a 建構函式 a onenter a onentertransitiondidfinish b 建構函式 a onexittransitiondidstart b onenter a onexit...