大约有 592 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0049 秒)
Laya_社区(424) Laya3.0_api(61) Laya2.0_示例(32) Laya_示例(31) Laya2.0_文档(30) Laya3.0_文档(11) laya_api(2) Laya2.0_api(1)
graphics如何实现橡皮擦效果 // 增加一个容器 var box = new Sprite(); // 设置容器为画布缓存 box.cacheAs = "bitmap"; this.layCanvas.addChild(box); // 绘制红色方块 var red = new Sprite(); red.graphics.drawRect(0, 0, 150, 150, "#ff0000"); box.addChild(red); // 绘制一个...
来源: Laya_社区 发布时间: 20170707
...2D图像。 Sprite 是基本的显示图形的显示列表节点。 通过 graphics 可以绘制图片或者矢量图,支持旋转,缩放,位移等操作。Sprite同时也是容器类,可用来添加多个子节点。Sprite针对不同的情况做了渲染优化,所以保证一个类实现...
来源: Laya3.0_文档 发布时间: 20251010
...mg:Image = new Image(); var t:Texture = Laya.loader.getRes(_resUrl); img.graphics.save();//必须要调用 否则报错 img.graphics.clipRect(100,100,200,200); img.graphics.drawTexture(t); img.graphics.restore(); this.addChild(img); 2019-01-11 0 0 分享 微博 QZONE 微信 为什么被折...
来源: Laya_社区 发布时间: 20190111
...er(); } function createInteractiveTarget() { var rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this,...
来源: Laya_示例 发布时间: 20251209
...st Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this,...
来源: Laya2.0_示例 发布时间: 20251209
... //使用Sprite对象的绘制纹理方式 a.graphics.drawTexture(texture1, 0, 0); this.owner.addChild(a) }); Laya.loader.load("http://103.219.177.59:63344/%2 ... ot%3B, Laya.Loader.TEXTURE2D).then((texture: Laya.Texture2D) =&...
来源: Laya_社区 发布时间: 20230316
...点的纹理 (this.owner as Laya.Sprite).graphics.clear(); var t: Laya.Texture = Laya.loader.getRes("puzzlePic/pi-" +this.levelNum +"-"+this.owner.name.slice(4,1)+ "-2.png"); (this.owner as Lay...
来源: Laya_社区 发布时间: 20201012
...ow.Laya.loader.load(value.url, ls.Handler.create(this, function () { _this.graphics.clear() var texture = window.Laya.loader.getRes(value.url) _this.graphics.drawTexture(texture) _this.scaleX = _this.set_width / texture.sourceWidth _this.pivotX = _this.row_data.property.x_m * texture.sourceWidth _th...
来源: Laya_社区 发布时间: 20180530
...二次贝塞尔曲线,开发者可以在API文档中搜索laya.display.Graphics类可以查看到“drawCurves();”曲线绘制方法。该方法的详细说明如下图所示:  (图8) 下面我们用LayaAir引擎绘制矢量曲线,示例代码如下: ```ty...
来源: Laya2.0_文档 发布时间: 20210715
...面基本都是大同小异,就是将sharedCanvas转成纹理再绘制到graphics上,这里推荐看下http://ask.layabox.com/question/15195这个文档,写的还算全面(虽说我不用,题外话) 二、如何有效的控制开放域界面的开关: 官方推荐的就是对上述的...
来源: Laya_社区 发布时间: 20181114