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

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

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

...sprite添加click监听事件反应迟钝 代码如下,如果用drawyuan.graphics.drawCircle(0,0,50,"#232628");则会点击反应非常迟钝,如果用loadimg的话,反应很快; function drawCirle() { var drawyuan = new Laya.Sprite(); // drawyuan.graphics.drawCircle(0,0,50,"#232628");//反...

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

172. 被遮罩的显示对象的子显示对象再添加遮罩,则子显示对象显示不正确 [ 84%]

...ask则正常显示。 let bigMask:Laya.Sprite = new Laya.Sprite(); bigMask.graphics.drawRect(0, 0, 300, 200, "#ffffff"); this.mask = bigMask; // let imgMask:Laya.Sprite = new Laya.Sprite(); imgMask.graphics.drawRect(0, 0, 100, 300, "#ffffff"); this.img.mask = imgMask; Laya.Tween.to(this.img, {x:100}...

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

173. 鼠标交互-修正交互区域 [ 84%]

...n); } function createCoralRect() { var coralRect = new Sprite(); coralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height / 2, "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; coralRect.size(Laya.stage.width, Laya.stage.height / 2); Laya.stage.addChild(coralRect); coralRec...

来源: Laya_示例 发布时间: 20251209

174. 小图集内存较大,且不能清理掉 [ 84%]

...图集能清除掉么? private function onLoad(tex:Texture):void { var g:Graphics = new Graphics(); g.drawTexture(tex, 0, 0); _s.graphics = g;        Laya.timer.once(2000, this, onClear); } private function onClear():void { _s.graphics.clear(); _s.destroy(true); _s.removeSelf(); _s...

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

175. 鼠标交互-修正交互区域 [ 83%]

...= Laya.Sprite, Event = Laya.Event; let coralRect = new Sprite(); coralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height / 2, "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; coralRect.size(Laya.stage.width, Laya.stage.height / 2); Laya.stage.addChild(coralRect); coralRec...

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

176. 被遮罩的对象的子显示对象再添加遮罩,子显示对象的遮罩显示不正确 [ 83%]

...ask则正常显示。 let bigMask:Laya.Sprite = new Laya.Sprite(); bigMask.graphics.drawRect(0, 0, 300, 200, "#ffffff"); this.mask = bigMask; // let imgMask:Laya.Sprite = new Laya.Sprite(); imgMask.graphics.drawRect(0, 0, 100, 300, "#ffffff"); this.img.mask = imgMask; Laya.Tween.to(this.img, {x:100}...

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

177. Sprite-切换纹理 [ 83%]

...var textureUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); var texture = Laya.loader.getRes(textureUrl); ape.graphics.drawTexture(texture, 0, 0); // 设置交互区域 ape.size(texture.width, texture.height); } })();module laya { import Sprite = Laya.Sprite; import ...

来源: Laya_示例 发布时间: 20251209

178. 关于大量绘制 draw的性能优化问题 [ 83%]

...nt.MOUSE_MOVE, this, mousemove); function  mousemove(e) {     drawLayer.graphics.drawCircle(e.target.mouseX,e.target.mouseY,20,"#ffffff")     drawLayer.cacheAsBitmap; }   我的思路是每一次move都把对应的圆形区域绘制到一个容器上,这样一来drawcall就不会一直增加...

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

179. Laya2.0绘制扇形遮罩,显示到部分角度时显示会有部分缺失(demo已上传) [ 83%]

... = 0 Laya.timer.loop(100, this, () => { if (r >= 360) r = 0; r++; sp.graphics.clear(true); sp.graphics.drawPie(0, 0, 50, 0, r, "#00ff1e"); sp2.graphics.clear(true); sp2.graphics.drawPie(0, 0, 50, 0, r, "#00ff1e"); }) 附件 : --> test.zip 2019-07-01 添加评论 免费帖 --> 分享 微博 QZO...

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

180. Sprite-切换纹理 [ 82%]

... let monkey = (this.flag = !this.flag) ? monkey1Res : monkey2Res; this.ape.graphics.clear(); this.ape.graphics.drawTexture(monkey, 0, 0); this.ape.size(monkey.width, monkey.height); } } new Sprite_SwitchTexture();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = ...

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