[]laya中js 如何实现Sprite类继承

求问题解决方法
主文件:a.js    组件文件:Role.js
a.js文件代码:
this.Role = new Role();
this.RoleMap = new Laya.Sprite();
this.RoleMap.size(Laya.stage.width, Laya.stage.height/2);
Laya.stage.addChild(this.RoleMap);
this.RoleMap.addChild(this.Role);
this.Role.pivot(16,24);// 图片32x48
this.Role.pos(100, 200);
 
Role.js基础代码:
var Role = ( function ( _super ) {
function Role () {
Role._super.call(this);
/***一些基础信息***/
}
Laya.class( Role , "Role" , Sprite );
var _proto_ = Role.prototype;
/******/
return Role;
})();
已邀请:

Laya_XS

赞同来自:

交给你一个笨的方法,就是参考官方的任何一个js文件,都有很多关于继承的写法,照着葫芦画瓢也可以搞定问题了。

152*****450

赞同来自:

已经解决了,改天把demo放上来~~

要回复问题请先

商务合作
商务合作