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

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

151. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 70%]

...): void { // 方法1:使用loadImage var ape: Sprite = new Sprite(); ape.pos(100,50); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); } } } new laya.Sprite_DisplayImage(); ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码运行效果如图2...

来源: Laya2.0_文档 发布时间: 20210715

152. Sprite-切换纹理 [ 70%]

....Sprite(); Laya.stage.addChild(this.ape); this.ape.pivot(55, 72); this.ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.switchTexture(); this.ape.on(Laya.Event.CLICK, this, this.switchTexture); } switchTexture() { let monkey = (this.flag = !this.flag) ? monkey1Res : monkey2Res; this.ape.gr...

来源: Laya2.0_示例 发布时间: 20251130

153. image.skin = base64 无效 [ 70%]

....graphics.drawRect(0, 0, 100, 100, "#ff0000"); Laya.stage.addChild(sp); sp.pos(100, 100); drawToc(sp); } private function drawToc(sp:Sprite):void { var canvas:HTMLCanvas= sp.drawToCanvas(100, 100, 0, 0); var ct:*= canvas.getContext("2d").canvas; var bs64:String = ct.toDataURL(); trace(bs64); var img...

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

154. 求绘制遮罩会引起黑屏的解决办法 [ 70%]

...svalue.anchorX = 0.5; this.progressvalue.anchorY = 0.5; this.progressvalue.pos(15, 15); //记录宽度 this.width_x = this.progress.width + 3;   this.vmask = new Laya.Sprite(); this.vmask.pos(15,15); this.vmask.graphics.drawPie(0, 0, 20, -90, 270, "#000000"); this.progress.addChild(this.progressval...

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

155. sprite添加click监听事件反应迟钝 [ 69%]

...r y = Math.random() * Laya.stage.height; console.log(x + "" + y); drawyuan.pos(x,y); return drawyuan; } 2017-09-05 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 cuixueying 赞同来自: 用下面的方法给circl...

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

156. 新手引导在ios浏览器表现异常 [ 69%]

...ideView.zOrder = MazeConst.gameZOrder;             guideView.pos(0,0);             Laya.stage.addChild(guideView);             guideView.setClickArea(Laya.stage.width/2, Laya.stage.height/2,100);         }     }     export class MazeGuideView...

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

157. 适配模式在 showall 模式下火狐(PC)的sizeGrid 特别容易出现间隙 [ 69%]

... (3).png"; dialog.sizeGrid = "40,40,40,40,0"; dialog.size(500,400); dialog.pos(165, 62.5); Laya.stage.addChild(dialog); } })();       在你们demo的基础上改的  pc的狐火下有问题  ie下应该也有 edge上不太确定 2017-08-28 0 0 分享 微博 QZONE 微信 a1284964657 赞同来...

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

158. 图片居中的问题 [ 69%]

...心点居中为止,修改方案:image的pivot移动了多上,你的pos向相反方向移动即可 shaouXie • 2016-11-21 15:37 @cuixueying:ok,直接用pos就实现了,不用pivot cuixueying • 2016-11-21 17:04 厉害,好的 shaouXie • 2016-11-22 15:37 @cuixueying:再咨询一个问...

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

159. 要让2DUI跟随3D物件,比如说敌人头上有血条。请问要怎么做? [ 69%]

...: let out = window.app.fcUtil.worldToViewportPoint(this.owner.transform.position, window.GameMag.Camera1); this.hpNode.x = out.x - this.hpNode.width / 2 this.hpNode.y = out.y + this.hpNode.height *3.5 //this.owner.transform 3d的物体 //this.hpNode 2d的ui   //3d坐标转2d屏幕坐...

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

160. Text->getCharPoint方法返回位置错误bug [ 69%]

...方法返回位置错误bug 1.当charIndex等于文本长度时,返回的pos.y永远是NaN 2.当文本水平对齐方式为right时,返回的pos.x比实际位置要向右偏移文本长度的距离 附件 : --> 2023-05-19 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关...

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