I inherit cc.Layer
var MYLayer = cc.Layer.extend({
>
>
init:function () {
>
var bRet = false;
if (this._super()) {
>
bRet = true;
}
return bRet;
},
>
onTouchesMoved:function (touches, event) {
this.processEvent( touches[0] );
},
>
onMouseDragged:function( event ) {
this.processEvent( event );
},
>
processEvent:function( event ) {
>
}
>
});
>
>
>
>
>
MYLayer.create = function () {
var sg = new MYLayer();
if (sg && sg.init()) {
return sg;
}
return null;
};
and call
var scene = cc.Scene.create();
scene.addChild(MYLayer.create());
>
cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene));
it reported
jsb_cocos2dx_auto.cpp: Line: 29998, Function: js_cocos2dx_CCLayer_init
Cocos2d: Invalid Native Object
Cocos2d: JS: Error: Invalid Native Object
Your comment welcome