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

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

1. 定时器 · LayaAir3.0文档 · LAYABOX [ 100%]

...Image.alpha = 0.5; }) } } 1.2 定时重复执行 (基于帧率) Laya.timer.frameLoop,定义如下: /** * 定时重复执行(基于帧率)。 * @param delay 间隔几帧(单位为帧)。 * @param caller 执行域(this)。 * @param method 定时器回调函数。 * @param args 回调参数。 * @p...

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

2. 2D性能优化 · LayaAir3.0文档 · LAYABOX [ 76%]

...环。 LayaAir提供两种计时器循环来执行代码块。 Laya.timer.frameLoop执行频率依赖于帧频率,可通过Stat.FPS查看当前帧频。 Laya.timer.loop执行频率依赖于参数指定时间。 Laya.timer.frameLoop(1, this, this.animateFrameRateBased); Laya.stage.on("click", this,...

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

3. 3D变换 · LayaAir3.0文档 · LAYABOX [ 64%]

...void { //设置定时器执行,定时重复执行(基于帧率) Laya.timer.frameLoop(1, this, this.animate); } private animate(): void { // 旋转立方体(四元数) this.cube.transform.rotate(this.rot, false, false); } } 旋转的效果如动图2-1所示: (动图2-1) 2.2 localRotationEul...

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

4. 组件属性的代码使用 · LayaAir3.0文档 · LAYABOX [ 59%]

...ation: Laya.Vector3 = new Laya.Vector3(0, 0.01, 0); onStart() { Laya.timer.frameLoop(1, this, ()=> { this.cube.transform.rotate(this.rotation, false); }); } } 效果如动图1-4所示: (动图1-4) 1.3 3D节点的进阶使用 @property( { type :Laya.Sprite3D } ) //节点类型 public p3d: La...

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

5. 基础文本 · LayaAir3.0文档 · LAYABOX [ 34%]

...本的初始化内容 } onStart(): void { let page: number = 1; Laya.timer.frameLoop(10, this, () => { page += 1; //在定时器中让变量page每次自增1 this.txt.setVar("n", page); //使用setVar方法,让text文本中变量n的值动态改变 }); } } 效果如动图1-6所示: (动图1...

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

6. 动画状态机详解 · LayaAir3.0文档 · LAYABOX [ 27%]

...this.animator.crossFade("Run", 0.1); //等待动画播放完成 Laya.timer.frameLoop(1,this,()=>{ //如果当前播放state已经播放完了一次 if(this.animator.getControllerLayer(0).getCurrentPlayState().normalizedTime >= 1){ //回到站立状态 this.animator.crossFade("Stand", 0.1); Lay...

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

7. 实体组件系统 · LayaAir3.0文档 · LAYABOX [ 15%]

...ation: Laya.Vector3 = new Laya.Vector3(0, 0.01, 0); onStart() { Laya.timer.frameLoop(1, this, ()=> { this.cube.transform.rotate(this.rotation, false); }); } } 效果如动图4-4所示: (动图4-4) 4.1.3 3D节点的进阶使用 @property( { type :Laya.Sprite3D } ) //节点类型 public p3d: ...

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