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

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

101. 请问Laya如果获取Laya.Event.CLICK时间的点击坐标? [ 71%]

...ect.on( Laya.Event.CLICK, this, changeVxVy ); } function changeVxVy( e ){ console.log( e.nativeEvent.offsetX ); console.log( e.nativeEvent.offsetY ); }   我设置了一个矩形,并给这个矩形增加了一个点击事件。 我发现e.nativeEvent.offsetX和e.nativeEvent.offsetY返回相对...

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

102. CommandBuffer_Outline 每次 addCommandBuffer都会永久增加10Gpu,removed掉相机事件也不会减少 [ 70%]

...MeshSprite3D) == null || !this.isUseOuline){            // console.log('spreite3D node meshSprite3D is null');            return;         }         var unlitMaterial = new Laya.UnlitMaterial();         unlitMaterial.albedoColor = new Laya...

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

103. Laya3d球星添加了刚体,但是碰撞无法触发onTriggerEnter的问题,120元有偿悬赏解答 [ 70%]

... onTriggerEnter,onTriggerStay,onTriggerExit 方法,并且在方法内有console.log输出,player设置了点击z方向向前移动   2、GameManager.ts:40-41行获取被碰撞体、72-94行管理被碰撞体和给每个被碰撞体添加了刚体,同时 isTrigger =true,isKinematic=true,...

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

104. matter中有没有类似于unity中的OnCollision碰撞检测函数呀,用js怎么写 [ 70%]

...', this.onCollision);   2.碰撞检测 private onCollision(event): void { console.log("碰撞了..");  var home = _gamePage._mainPage._playPage;  for(var i = 0; i < event.pairs.length; i++) {  var pair = event.pairs[i];  if(!(pair.bodyA.label === 'gun' || pair.bodyB.label == "gun")) continue...

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

105. 有关Laya3D碰撞检测疑问 [ 70%]

...体";  Laya.timer.frameLoop(1, this, this.checkHit);  this.loadUI();  console.log("碰撞结果:" + boxCollider1.boundBox.containsSphere(cylinder.meshRender.boundingSphere)); console.log("碰撞结果:" + boxCollider1.boundBox.containsBoundBox(cylinder.meshRender.boundingBox)); console.log("碰...

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

106. 微信小游戏运行导出项目的时候报错:Scene: the .lh file root type must be Scene [ 70%]

...t Function.Loader.checkNext (http://127.0.0.1:59022/game/code.js:12769:40) console.error errorReport @ WAGame.js:3 thirdErrorReport @ WAGame.js:3 (anonymous) @ WAGame.js:3 c @ WAGame.js:4 (anonymous) @ WAGame.js:4 function.setTimeout @ gamePage.html:1 (anonymous) @ WAGame.js:3 (anonymous) @ WAGame.j...

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

107. 版本号:2.0.2 beta, 在sound文件夹下音乐播放不了,放入到res文件夹下可播放 [ 70%]

...tring:string = "./sounds/hit.wav";  private onPlayMusic(e: Event): void { console.log("播放音乐"); SoundManager.playMusic(this.musicString, 1, new Handler(this, this.onComplete)); }  private onPlaySound(e: Event): void { console.log("播放音效"); SoundManager.playSound(this.soundString, 1, ...

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

108. Native IOS下获取陀螺仪数据为0 [ 70%]

....alpha === null)             {                      console.log("当前设备不支持陀螺仪。");                      //去掉陀螺仪的移动                      Laya.Gyroscope.instance.off(Laya.Event.CHANGE, this, this.onOrientationChange);   ...

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

109. HTMLDivElement中图文混排怎么获取实际内容大小 [ 70%]

...MLDivElement(); imageHtml.innerHTML="<img src='res/image/1.png' />"; console.log("size: " + imageHtml.width + ", " + imageHtml.height); console.log("contextSize: " + imageHtml.contextWidth + ", " + imageHtml.contextHeight); Laya.stage.addChild(imageHtml);   上述代码在Laya中运行 正确...

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

110. ZipFile类用readFile读取文件内容时,整个界面都会卡住 [ 69%]

...hstr('/' + name); if (window["appcache"].updateFile(fid, 0, buf, false)) { console.log("更新缓存文件" + fid + "成功"); } else { console.log("更新缓存文件" + fid + "失败"); } } }); zip.close();//执行这一步时界面恢复正常 2018-12-28 添加评论 免费帖 --> 分享 微博 Q...

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