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

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

91. 克隆sprite [ 87%]

...克隆sprite 什么克隆一个对象啊?  在下面的“   tempSpr2.graphics.drawTexture(tempSpr.texture, 0, 0, tempSpr.width, tempSpr.height);”中 tempSpr.texture 是空的 if (data && data.items != []) {             let tempSpr: Sprite = new Sprite();             let...

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

92. 屏幕适配-缩放-Show All [ 87%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Lay...

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

93. 屏幕适配-缩放-Extract Fit [ 87%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Lay...

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

94. 动态创建img 或 sprite [ 87%]

LayaAir引擎 动态创建img 或 sprite let dd = new Laya.Sprite(); dd.graphics.drawTexture(this.img.texture, 0, 0, 750, 1334); dd.x = 50; dd.y = 50; this.addChild(dd);   this.img 绝对不为空,我想用一个sprite来画它,请问什么画(不是拷贝)?   2018-01-24 添加评论 ...

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

95. 关于customRender函数不执行的问题 [ 87%]

... // 保证customRender必定执行 this.frameLoop(1, this, () => { this.graphics.clear(); this.graphics.drawLine(0, 0, 1, 0, '#000'); }); this.customRenderEnable = true; this.customRender = (context: Laya.RenderContext, x: number, y: number) => { let webGLContext = context.ctx as Laya.WebGLCon...

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

96. graphics持续绘制扇形问题 [ 87%]

graphics持续绘制扇形问题 private function onLoaded():void { //实例UI界面 var testView:TestPageUI = new TestPageUI(); Laya.stage.addChild(testView);   pie = new Sprite(); Laya.stage.addChild(pie); Laya.timer.frameLoop(1,this,onLoop); }   private var curAngle:Number = 0; private functio...

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

97. 关于Sprite回收 [ 87%]

...            Pool.recover("item", item);                 item.graphics.clear();             }    item的父容器是通过回收池获取的,父容器带有原来的item,现在希望删掉原来的item,添加新的item,使用上面的代码去达不到效果,结果是...

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

98. Laya场景编辑时加入的Graphics组件,代码中该如何获取? [ 87%]

UI相关问题 Laya场景编辑时加入的Graphics组件,代码中该如何获取? UI编辑模式下加入了一个Graphics->Rect组件,如何在代码中获取这个Rect组件,以便进行下一步的变换?   如果是个Button的话,可以通过类似的代码来声明、获取...

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

99. [LayaAirIDE3]2d相机打包后问题 [ 87%]

...a.loader.getRes("res/building.png");                 this.building.graphics.drawTexture(texture, 0, 0);             }),             null,             Laya.Loader.IMAGE         );     }      // 可视化边界     private visualizeBoundaries() {         const ...

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

100. 在Laya2上 getGraphicBounds获取失败 [ 87%]

在Laya2上 getGraphicBounds获取失败 =10.5pt看4张图就知道了,图片是有加载显示成功,但是在handler里面返回的参数为undefined,getGraphicBounds内容始终为0   附件 : --> 2018-11-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀...

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