大约有 122 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0044 秒)
...r.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化角色 this.hero.init("hero",0,1,0,30); // 设置射击类型 this.hero.shootType = 1; // 设置主角的位置 this.hero.pos(200,500); // 放置到舞台上 Laya.stage.addChild(this.hero); // 监听舞台...
来源: Laya_社区 发布时间: 20170525
...r.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化角色 this.hero.init("hero",0,1,0,30); // 设置射击类型 this.hero.shootType = 1; // 设置主角的位置 this.hero.pos(200,500); // 放置到舞台上 Laya.stage.addChild(this.hero); // 监听舞台...
来源: Laya_社区 发布时间: 20170525
...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.pi...
来源: Laya_社区 发布时间: 20181012
var enemy = Laya.Pool.getItemByClass("role", Role); 失败 附件 : --> 2017-10-20 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Monica - 知识达人 赞同来自: 你先跟视频中的代码对比下是...
来源: Laya_社区 发布时间: 20171020
Laya.stage.getChildAt(i) as Role 在js下的写法是什么? var role: Role = Laya.stage.getChildAt(i) as Role; 怎么用js 实现,在js中没有 as 写法,在js中 var role =Laya.stage.getChildAt(i); 得到的role 是Laya.Sprite类 不是我定义的Role 2016-08-28 添加评论 免费帖 -->...
来源: Laya_社区 发布时间: 20160828
前述问题this.sp3Role.transform.position无效 您好,之前这个帖子(http://ask.layabox.com/question/50395)你们回复的this.sp3Role.transform.position这个方法只让主角移动和camera.transform.position相机跟随无效,因为主角无法移动,camara还没办法尝试,...
来源: Laya_社区 发布时间: 20220622
...= 0,y =80; Laya.stage.addChild(container); for(var i=0;i<1200;i++){ var role = new Laya.Sprite(); x = x+0.1; y = y+0.1 role.x = x; role.y = y; role.loadImage('comp/bg.png'); container.addChild(role); var role2 = new Laya.Sprite(); x = x+0.1; y = y+0.1 role2.x = x; role2.y = y; role2.loadImage('co...
来源: Laya_社区 发布时间: 20180122
... tiledMap 中 设置对象 坐标未 96,128 为何在laya 中读取 this.role = tMap.getLayerObject("role","player"); 后 role的坐标会是112,112 Laya.init(3200,3200); //创建TiledMap实例 var tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect = new Laya.Rect...
来源: Laya_社区 发布时间: 20171124
matter中layasprite怎么改变图片大小? var roleOptions: any = {mass:1, restitution:0.8, layaSprite: sprite}; var role: any = Matter.Bodies.rectangle(180, 450, 334, 522, roleOptions); 代码类似这样的:sprite是我传入的图片,要怎么改变这张图片的大小? 2018-08-...
来源: Laya_社区 发布时间: 20180827
...考如下: 第二个问题:this.body和this.hero的区别 this.body是Role类下的animation实例:是个Animation this.hero是Role类的实例:是个Sprite(因为Role继承自Sprite) 第三个问题: 为什么Role类下设置body.pos为机身瞄点 因为body是位于Role下的实例...
来源: Laya_社区 发布时间: 20160729