Skip to content

Instantly share code, notes, and snippets.

@Seasons7
Created September 22, 2013 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Seasons7/6656002 to your computer and use it in GitHub Desktop.
Save Seasons7/6656002 to your computer and use it in GitHub Desktop.
call this._super() sample
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