cocos2d-x + lua에서 이벤트 없음EnterTransitionDidFinish

1152 단어 functionlua
--[[
     
    hi.baidu.com/xingyan126
    [email protected]
]]

UISceneMain = CCScene:create()

UISceneMain.size = CCDirector:sharedDirector():getWinSize()
-- --------------------------
function UISceneMain:init()
    self.scene  = self
    self.scene:addChild(CCLayerColor:create(ccc4(50, 185, 179, 255), self.size.width, self.size.height))
    CCDirector:sharedDirector():runWithScene(self.scene)
    self:registerScriptHandler(sceneEventHandler) 
end
-- onEnter() ------------------
function UISceneMain:onEnter()
    print('===== =====')
end
-- 
function UISceneMain:onEnterTransitionDidFinish()
    print('=========== ======')
end 

    
function sceneEventHandler(eventType)  
    if eventType == kCCNodeOnEnter then  
        UISceneMain:onEnter()  
    else  
        print('========== :'..eventType)
    end  
end

-- --------------------------- 
UISceneMain:init()

 scene onEnter() 
 onEnterTransitionDidFinish() 
 cocos2d-x ?
 

좋은 웹페이지 즐겨찾기