• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 122 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0044 秒)

1. 为什么会出现报错 ani not found:ufo1_down [ 100%]

...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

2. 为什么会出现报错 ani not found:ufo1_down [ 99%]

...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

3. laya中js 如何实现Sprite类继承 [ 96%]

...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

4. var enemy = Laya.Pool.getItemByClass("role", Role); 失败 [ 96%]

var enemy = Laya.Pool.getItemByClass("role", Role); 失败     附件 : --> 2017-10-20 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Monica - 知识达人 赞同来自: 你先跟视频中的代码对比下是...

来源: Laya_社区 发布时间: 20171020

5. Laya.stage.getChildAt(i) as Role 在js下的写法是什么? [ 96%]

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

6. 前述问题this.sp3Role.transform.position无效 [ 94%]

前述问题this.sp3Role.transform.position无效 您好,之前这个帖子(http://ask.layabox.com/question/50395)你们回复的this.sp3Role.transform.position这个方法只让主角移动和camera.transform.position相机跟随无效,因为主角无法移动,camara还没办法尝试,...

来源: Laya_社区 发布时间: 20220622

7. drawcall优化问题 [ 93%]

...= 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

8. TiledMap.getLayerObject [ 93%]

... 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

9. matter中layasprite怎么改变图片大小? [ 93%]

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

10. 为什么获取不到getBounds()的width,height [ 92%]

...考如下: 第二个问题:this.body和this.hero的区别 this.body是Role类下的animation实例:是个Animation this.hero是Role类的实例:是个Sprite(因为Role继承自Sprite) 第三个问题: 为什么Role类下设置body.pos为机身瞄点 因为body是位于Role下的实例...

来源: Laya_社区 发布时间: 20160729