Created
September 22, 2013 02:02
-
-
Save Seasons7/6656002 to your computer and use it in GitHub Desktop.
call this._super() sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("jsb.js"); | |
try { | |
director = cc.Director.getInstance(); | |
winSize = director.getWinSize(); | |
centerPos = cc.p( winSize.width/2, winSize.height/2 ); | |
var Person = cc.Node.extend({ | |
ctor: function() { | |
this._super(); | |
cc.log("Hello cocos2d-x jsb"); | |
} | |
}); | |
var GameLayer = cc.Layer.extend({ | |
// Constructor | |
ctor:function () { | |
this._super(); | |
this.init(); | |
var p = new Person(); | |
} | |
}); | |
function run() | |
{ | |
var scene = cc.Scene.create(); | |
var layer = new GameLayer(); | |
scene.addChild( layer ); | |
director.runWithScene( scene ); | |
} | |
__jsc__.garbageCollect(); | |
run(); | |
} catch(e) {log(e);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment