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

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

1. 缓动 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...缓动 * aSprite为一个2D精灵 */ Laya.Tween.create(aSprite).duration(1000).to("x", 500).to("y", 300); 将这段代码添加在节点上的脚本中,运行查看效果,如图3-1-1所示: (图3-1-1) 下面我们来讲解一下这段代码: 1. 使用create()方法创建一个缓动,...

来源: Laya3.0_文档 发布时间: 20251010

2. 位图切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

...this.clip.skin = "atlas/comp/clip_num.png"; // 皮肤 this.clip.interval = 1000; // 切片动画的播放时间间隔1000毫秒 this.clip.clipX = 10; // 切片x轴数量 this.clip.autoPlay = true; // 动画自动播放 } } 二、通过代码创建Clip组件 在进行书写代码的时候,免不了...

来源: Laya3.0_文档 发布时间: 20251010

3. 2D自由形态光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 67%]

...画 this.lightComp.lightRotation += this.rotateSpeed * Laya.timer.delta / 1000; // 实现灯光缩放动画 this.scaleTime += Laya.timer.delta / 1000 * this.scaleSpeed; const scale = 1 + Math.sin(this.scaleTime) * 0.5; // 增加缩放变化幅度 this.lightComp.lightScale.setValue(scale, scale); } }...

来源: Laya3.0_文档 发布时间: 20251010

4. 2D精灵光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 67%]

...ya.Mesh2DRender); mesh2Drender.sharedMesh = this.generateRectVerticesAndUV(1000, 1000); mesh2Drender.lightReceive = true; } // 生成一个矩形 private generateRectVerticesAndUV(width: number, height: number): Laya.Mesh2D { const vertices = new Float32Array(4 * 5); const indices = new Uint16Array(...

来源: Laya3.0_文档 发布时间: 20251010

5. 资源加载 · LayaAir3.3 · 引擎文档 · LAYABOX [ 61%]

...wner.addChild(sp); let i: number = 0; //每秒重画一次 Laya.timer.loop(1000, this, () => { i == res.length && (i = 0); //清除sp节点的所有绘图(不含子节点) sp.graphics.clear(); //在sp节点上重绘纹理 sp.graphics.drawTexture(res[i]); i++; }); }); } } 2.2 可带类...

来源: Laya3.0_文档 发布时间: 20251010

6. 2D光遮挡器与阴影 · LayaAir3.3 · 引擎文档 · LAYABOX [ 59%]

...ya.Mesh2DRender); mesh2Drender.sharedMesh = this.generateRectVerticesAndUV(1000, 1000); mesh2Drender.texture = tex; mesh2Drender.lightReceive = true; } // 生成一个矩形 private generateRectVerticesAndUV(width: number, height: number): Laya.Mesh2D { const vertices = new Float32Array(4 * 5); cons...

来源: Laya3.0_文档 发布时间: 20251010

7. 定时器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 58%]

... onAwake(): void { //1秒后,图片的透明度变为0.5 Laya.timer.once(1000, this, () => { this.Image.alpha = 0.5; }) } } 2.2 定时重复执行(单位为毫秒) Laya.timer.loop,定义如下: /** * 定时重复执行。 * @param delay 间隔时间(单位毫秒)。 * @param caller 执行...

来源: Laya3.0_文档 发布时间: 20251010

8. 使用3D UI · LayaAir3.3 · 引擎文档 · LAYABOX [ 58%]

...“远平面”之间,如图3-11所示,距离需要大于0.3且小于1000。 (图3-11) 四、脚本控制 开发者通常需要对UI中的内容进行操作,例如,血条中血量比例的变化,有向上飘动的伤害数等,这些都是通过对Prefab2D中UI组件控制来实现的...

来源: Laya3.0_文档 发布时间: 20251010

9. 开放数据域组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 50%]

...e 两个属性的对象。 let KVData = { key: "test" + i, value: "" + i * 1000, } KVDataList.push(KVData); } /** * KVDataList:KV 数据列表 * success:接口调用成功的回调函数 * fail:接口调用失败的回调函数 * complete:接口调用结束的回调函数(调用成功、...

来源: Laya3.0_文档 发布时间: 20251010

10. 2D方向光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 49%]

...: void { // 更新时间 this.dayTime = (this.dayTime + Laya.timer.delta / 1000) % this.dayDuration; const totalMinutes = Math.floor((this.getAdjustedProgress()) * 24 * 60); const hours = Math.floor(totalMinutes / 60); const minutes = totalMinutes % 60; const timeString = `${this.padNumber(hours)}:$...

来源: Laya3.0_文档 发布时间: 20251010