app.js
var HelloWorldLayer = cc.@H_403_12@Layer.extend({ @H_403_12@sprite: null, ctor: function () { ////////////////////////////// // 1. super init first this.@H_403_12@_super(); ///////////////////////////// // 2. add a menu item with "X" image,which is clicked to quit the program // you may modify it. // ask the window size var size = cc.@H_403_12@winSize; // 加载Cocos Studio资源 var mainscene = ccs.load(res.@H_403_12@MainScene_json); this.addChild(mainscene.@H_403_12@node); var startButton = ccui.@H_403_12@helper.seekWidgetByName(mainscene.@H_403_12@node,"Button_1"); startButton.addTouchEventListener(this.onClick,this); return true; }, onClick: function (sender,type) { switch (type) { case ccui.@H_403_12@Widget.@H_403_12@TOUCH_BEGAN: break; case ccui.@H_403_12@Widget.@H_403_12@TOUCH_MOVED: break; case ccui.@H_403_12@Widget.@H_403_12@TOUCH_ENDED: console.log("startButtonOnClick"); cc.@H_403_12@director.runScene(new GameScene);
break;case ccui. @H_403_12@Widget. @H_403_12@TOUCH_CANCELED: break ; } }}) ; var HelloWorldScene = cc. @H_403_12@Scene. extend({ onEnter: function () { this. @H_403_12@_super() ; var layer = new HelloWorldLayer() ; this. addChild(layer) ; }}) ;