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

大约有 518 项符合查询结果, 库内数据总量为 30,902 项。 (搜索耗时: 0.0070 秒)

21. 两个移动的简单物体 onTriggerEnter 无法触发 (有悬赏) [ 85%]

...方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other){ console.log("onTriggerEnter"); };  onTriggerStay(other){ console.log("onTriggerStay"); };  onCollisionEnter(other){ console.log("onCollisionEnter"); };  onCollisionStay(collision){ console.log("onCollisionStay"); } } 附...

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

22. list只能显示一个图片 [ 85%]

...) { var item = {pic:{skin:'cards/'+i+'tong.jpg'}}; this.data.push(item); } console.log(this.data); this.list1.dataSource = this.data; this.list1.x = 50; this.list1.y = 500; this.list1.getChildAt(0).height = 100; this.list1.vScrollBarSkin = ""; this.list1.hScrollBarSkin = "comp/hscroll.png"; this.lis...

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

23. 三个图好像无法绑定不同的事件? [ 85%]

... Laya.stage.addChild(img1); img1.on(Laya.Event.CLICK,this, function(name){ console.log(name);},['图1']); var img2 = new Laya.Sprite(); img2.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/apes/monkey2.png',200,300,90,90); Laya.stage.addChild(img2); img2.on(Laya.Event.CLICK,this, function(nam...

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

24. 如何在游戏入口处获取对象的子对象 [ 84%]

...ed = function(){ this.pass = this.map.getLayerByIndex(0);//获取通行层 console.log(this.pass); } _proto.getLayer = function() { this.floor = this.map.getLayerByIndex(0);//获取通行层 console.log(this.pass); } console.log(this.map) return loadMap; })(Sprite);**游戏主入口** var Main = (fu...

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

25. 射线检测报错,outHitInfo.sprite3D=null; [ 84%]

...is.camera = this.scene.scene.getChildByName("Main Camera") as Laya.Camera; console.log("当前摄像机的名字是:" + this.camera.name); }  public _start(state:Laya.RenderState):void{ this.ray = new Laya.Ray(Laya.Vector3.ZERO,Laya.Vector3.ZERO); this.phasorSprite3D = new Laya.PhasorSpriter3D();...

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

26. 无法获取音频的时间长度 [ 84%]

...d/dh/gril1.wav", 1,Laya.Handler.create(this,() => {       }));     console.log(soundChItem.position+"");     console.log(soundChItem.duration+""); 附件 : --> 2023-05-19 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提...

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

27. 发布时勾选压缩js后,gulp uglify生成的sourcemap在哪里 [ 84%]

...cemaps.write(releaseDir + '/../sourcemaps')) .on('error', function (err) { console.warn(err.toString()); }) .pipe(gulp.dest(releaseDir)); } }); 可以看到laya是用uglify工具压缩的js 2、生成js对应的 .js.map文件 .js.map :map文件是js文件压缩后,文件的变量名替换对应...

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

28. 各位大佬,帮我看看 tiledMap 中获取不到自定义属性 [ 84%]

... var data = this.tiledMap.getLayerByIndex(3).getTileData(tileX, tileY); // console.log(data) // console.log(Laya.Keyboard.RIGHT) switch (e.keyCode) { //右边 case 39: { this.player.x += 16 break; } case 37: { //左边 this.player.x -= 16 break; } case 38: { //上 this.player.y -= 16  break; } case...

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

29. 最新版本IDE,如何获取http返回的json数据 [ 84%]

... //注册按钮响应函数 Login.prototype.onButtonLogin = function (){ console.log ('按了登录按钮')  var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.once(Event.PROG...

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

30. 2.4 生命周期触发多次,连constructor都执行了两次 [ 83%]

...命周期触发多次,连constructor都执行了两次 onAwake():void { console.log("onAwake"); } onStart():void { console.log("onStart"); } onEnable():void { console.log("onEnable"); } onDisable():void { console.log("onDisable"); } 附件 : --> 2019-12-09 添加评论 免费帖 --> 分享 微博 ...

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