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

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

511. 鼠标交互-自定义事件 [ 71%]

... Sprite = Laya.Sprite, Event = Laya.Event; this.sp = new Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y = Laya.stage.height / 2; this.sp.size(200, 200); Laya.stage.addChild(this.sp); this.sp.on(ROTATE, this, this.o...

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

512. 微信小游戏截图问题 [ 71%]

...vas.height, destWidth: canvas.width, destHeight: canvas.height }) this.ctx.graphics.loadImage(wxhtmlC, 0, 0,this.ctx.width,this.ctx.height); 然后用drawTextture,很多问题都是有这个,可以带到下面那些东西怎么转成图片呢? var htmlC = Laya.stage.drawToTexture(Laya.stage.wi...

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

513. drawToCanvas的问题 [ 71%]

...ameLoop(1, this, ()=> { angle +=1; if(angle > 360) { angle = 0; } sp.graphics.clear(); sp.graphics.drawPie(128,128,128,0,angle,"0xff0000"); var tex = sp.drawToTexture(256,256,0,0); //var html:Laya.HTMLCanvas = sp.drawToCanvas(256,256,0,0); //img.loadImageSource(html.source,true); //html.clear(...

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

514. 用drawPie绘制的sprite用于遮罩mask,会出现错乱。 [ 71%]

...sprite用于遮罩mask,会出现错乱。 在frameLoop下,每次执行graphics.clear(),graphics.drawPie(...),扇形本身是没有问题的,但用于mask后,会出现显示混乱:抖动、漏线。具体如图: 附件 : --> 2017-03-08 添加评论 免费帖 --> 分享 微博 QZONE 微...

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

515. 舞台上有个label,我能通过截图保存成图片么 [ 71%]

...ER; Laya.stage.alignV = Stage.ALIGN_MIDDLE; var sp:Sprite=new Sprite(); sp.graphics.drawRect(0,0,200,200,"#EEFF00"); var label:Label=new Label(); label.fontSize=60; label.text="666"; label.bold=true; label.color="#000000"; sp.addChild(label); sp.size(200,200); Laya.stage.addChild(sp); Laya.timer.fra...

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

516. 扇形遮罩问题。 [ 71%]

... var sp:Sprite = new Sprite(); Laya.stage.addChild(sp); sp.alpha = 0.8; sp.graphics.drawRect(50,50,50,50,"#ff0000"); var sp1:Sprite = new Sprite(); sp1.alpha = 0.5; //Laya.stage.addChild(sp1); //画扇形 当这个扇形画的角度是 0-360度时 舞台上红色矩形不见了 sp1.graphics.drawPie(...

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

517. 设置pivot后,精灵位置显示位置不正确 [ 71%]

...ight) this.sp.pivot(Math.round(width / 2), Math.round(height / 2)) this.sp.graphics.drawCircle(0, 0, 5, "#000000") this.sp.graphics.drawRect(-this.sp.pivotX, -this.sp.pivotY, width, height, undefined, "#00ff00", 1) this.sp.pos(500, 500) Laya.stage.addChild(this.sp); } } new GameMain();这是运行...

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

518. 安卓机截图变成黑块,ios和pc没问题 [ 71%]

...色块了private function test():void { var sp1:Sprite = new Sprite(); sp1.graphics.drawRect(0,0,300,200,"#ff0000"); var htmlCanvas:HTMLCanvas = sp1.drawToCanvas(300,200,0,0); Laya.timer.once(1000,this,function():void{ var texture:Texture = new Texture(htmlCanvas); var sp2:Sprite = new Sprite(); sp2...

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

519. Sprite-遮罩-放大镜 [ 71%]

...oader.getRes(maskPath); let bg = new Sprite(); Laya.stage.addChild(bg); bg.graphics.drawTexture(bgRes); let bg2 = new Sprite(); Laya.stage.addChild(bg2); bg2.graphics.drawTexture(bgRes); bg2.scale(3, 3); // 创建mask let maskSp = new Sprite(); maskSp.graphics.drawTexture(maskRes); maskSp.pivot(50, ...

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

520. laya.map.TileAniSprite [ 71%]

...ge的全局Y轴缩放值(会叠加父亲节点的缩放值)。 Sprite graphics : Graphics绘图对象。封装了绘制位图和矢量图的接口,Sprite所有的绘图操作都通过Graphics来实现的。Sprite height : Number 显示对象的高度,单位为像素,默认为0。 此高...

来源: laya_api 发布时间: 20170929