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

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

41. 关于缓动函数from的一些问题记录 [ 76%]

...onsole.log("update"); var c = Math.floor(Math.random()*4); console.log(c); switch(c) { case 0:text.color='red';break; case 1:text.color="blue";break; case 2:text.color ='black';break; case 3:text.color = 'green';break; case 4:text.color = "yellow";break; } console.log(text.color); } ```注意Props...

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

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

...yA.label === 'gun') { other = pair.bodyB; } else { other = pair.bodyA; }  switch(other.label) { case "gameover": { home.onGameOver(); } break;  case "coin": { home.gainCoin(1); } break;  case "bullet": { home.gainBullet(1); } break; }  console.log("删除物体:", other.label);  home.Matter.Wor...

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

43. 引擎 TiledMap 居然不支持图块翻转 [ 75%]

...         this._mapHeightHalf = this._map.height / 2;             switch (layerData.type) {                 case "tilelayer":                     break;                 case "objectgroup":                     var tArray = layerData.objects;          ...

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

44. 分享,扩展Laya.Text组件实现简单的富文本 [ 74%]

...awUnderline(align, x, y, lineIndex) { var lineWidth = this.underLineWidth; switch (align) { case 'center': x -= lineWidth / 2; break; case 'right': x -= lineWidth; break; case 'left': default: break; } y += this._charSize.height; this._graphics.drawLine(x, y, x + lineWidth, y, this.underColor || thi...

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

45. socket大型项目回调 [ 73%]

... for (var name in msg) { if (protos[name]) { var proto:any = protos[name]; switch (proto.option) { case "optional": case "required": buffer.writeArrayBuffer(this.encodeTag(proto.type, proto.tag)); this.encodeProp(msg[name], proto.type, protos, buffer); break; case "repeated": if (!!msg[name] &&a...

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

46. Laya.loader.load(xx) 当地址""的时候,会报错。 [ 72%]

...           let format;                     switch (ext) {                         case "ktx":                             format = exports.TextureFormat.ETC1RGB;                         ...

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

47. 分享2.0 使用官方的woker.js 游戏无法运行的问题 [ 71%]

... onmessage = function(t) { var e = t.data; e = { type: "load", url: e }; switch (e.type) { case "load": loadImage2(e) } }; 原因在于worker中接受的参数 与所需的格式不符 手动修改下就好了 2020-10-21 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 ...

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

48. Laya.Event.MOUSE_MOVE的触发问题 [ 70%]

Laya.Event.MOUSE_MOVE的触发问题 switch (e.type) case Laya.Event.MOUSE_MOVE:有的手机点击就触发move,例如个别oppo机,iphonexr 有的手机点击不触发move,例如iphone12pro 附件 : --> 2021-11-15 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已...

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

49. 2.0.2使用worker加载图片的问题 [ 68%]

...后 在worker.js中执行了这句话`onmessage=function(t){var e=t.data;switch(e.type){case"load":loadImage2(e)}};`,e=t.data,也就是上面postMessage中的url,是一个字符串,那么e.type是undefined,根本不会执行到loadImage2(e)。 附件 : --> Demo.rar 2019-06-05 添加评论 ...

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

50. canvas下资源清理的问题 [ 67%]

...rivate function onClick(e:Event):void         {             switch(e.currentTarget)             {                 case btn1:                     show();                     break;                 case btn2:         ...

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