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

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

141. 怎么给List下的每个item中的button添加事件? [ 69%]

...;,i*100,800,100,60); btn.id= i; btns.push(btn); this.btnBox.addChild(btn); console.log(btn.id); } for(var i = 0; i < 5; i++){ btns[i].on(Laya.Event.CLICK,this,judge,[i]); } function judge(aa){ console.log("___________"+aa); } 我就是这么做的,结果打印出来全是4,前面的...

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

142. 打包百度小游戏不能播放声音?是api不支持 还是发生了改变 或者格式问题? [ 69%]

...片了  直接附上 上图红框内的修改  if (Browser.onMiniGame){ console.log(1); tSound=Laya.loader.getRes(url); } if (!soundClass)soundClass=SoundManager._soundClass; if (!tSound){ console.log(2); tSound=new soundClass(); tSound.load(url); if (Browser.onMiniGame){ Loader.cacheRes(url,...

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

143. 在线急等,发现你们这个编译器一个bug,不能实现负负得正 [ 69%]

...moveDownBall = function(){ this.ball.x -= this.vx; this.ball.y += this.vy; console.log("111111"); this.vy *= 0.99; this.vy += 0.25; console.log("222222"); if (this.ball.y + this.vy >= this.stageHeight ||this.ball.y + this.vy <= 0) { this.vy = -this.vy; } if (this.ball.x + this.vx >= this.st...

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

144. 资源压缩成zip后加载的问题 [ 69%]

...Laya.loader.load("res/aaa.scene", Laya.Handler.create(null, (content)=>{console.log(content)})); Laya.loader.load("res/bbb.json", Laya.Handler.create(null, (content)=>{console.log(content)})); 2019-04-25 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题目前已...

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

145. LocalStorage的bug [ 69%]

....removeItem('laya');Storage.support = true;} catch(e){}if(!Storage.support)console.log('LocalStorage is not supprot or browser is private mode.')"); }   改成 public static function init():void { __JS__("try{Storage.items=window.localStorage;Storage.setItem('laya', '1');Storage.removeItem('laya');...

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

146. 给模型动态添加脚本报错 [ 69%]

...tPos.z + (2.5 - Math.random() * 5));                 console.log('----------------goldnode', goldNode);                 this.playerGoldArr.push(goldNode);                 goldNode.addComponent(goldItemNode);     报错信息: Uncaught TypeEr...

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

147. timeline 类动作节点回调 [ 69%]

...); timeLine.on(Event.LABEL, this, this.onLabel); } function onComplete() { console.log("timeLine complete!!!!"); } function onLabel(label) { console.log("LabelName:" + label); }少年 没仔细看官方的案例吧 这个Label时间就是每一小节动画都会 触发 同时会告诉你当前是那...

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

148. 载入场景报错 [ 69%]

...nH = Laya.Stage.ALIGN_CENTER; Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE; console.log("load"); Laya.loader.create("TestScene/TestScene.ls", Laya.Handler.create(this, this.LoadSceneComplete)); } LoadSceneComplete() { console.log("finish") let scene: Laya.Scene = Laya.loader.getRes("TestScene/TestSce...

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

149. 通过getChildByName找到的dialog节点使用show方法后, 再次getChildByName查找, 结果为null [ 68%]

... let childNode = parentNode.getChildByName('Dialog'); childNode.show();   console.log(parentNode.getChildByName('Dialog'));  // 结果为null   2016-09-13 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 cuixueyi...

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

150. 我二进制资源load之后,为什么通过getRes获取不到。 [ 68%]

...ndler.create(this, this.onProcess), null, 1, false); } onComplete(e,a,b) { console.log('资源加载完成!!',e,a,b); var cfg = Laya.Loader.getRes("config/data.txt"); console.log('cfg===',cfg, Laya.Loader.groupMap); } 2018-08-16 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到...

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