Home > other >  Cocos2dx - lua button response grammar problems
Cocos2dx - lua button response grammar problems

Time:09-25

Json=cjson
The require "Cocos2d"
The require "Cocos2dConstants
"- the require "SystemConst
"
TRUE=1
FALSE=0
The function LOCALSTR (STR)
Return the STR
End
- set dir
Cc. FileUtils: getInstance () : addSearchPath (" SRC ")
Cc. FileUtils: getInstance () : addSearchPath (" res ")
The local sceneGame=cc. Scene: the create ()

The local uilayer=CCS. GUIReader: getInstance () : widgetFromJsonFile (" publish/zhuanpan. ExportJson ")
Local closebtn=ccui. Helper: seekWidgetByTag (uilayer, 248507) setVisible (false)
MUiUtility. AddClose (uilayer, 248507, the self) -- the top right corner to close the button
Closebtn: addTouchEventListener (self: CloseHandle ())

SceneGame: addChild (uilayer)
Cc. Director: getInstance () : runWithScene (sceneGame)
I am a beginner, use lua calls the cocos studio export of UI want to join button to respond to events, first add a close button, but finished the operation is the black screen, could you tell me where I write wrong? Urgent, please (ps: version is old, the great god understanding)
  • Related