[]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;
})();
主文件: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;
})();
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Laya_XS
赞同来自:
152*****450
赞同来自: