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

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

11. 3D变换 · LayaAir3.3 · 引擎文档 · LAYABOX [ 91%]

...在x、y和z方向上分别移动距离1,示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Sprite3D }) public cube: Laya.Sprite3D; // 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); c...

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

12. 视频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 91%]

...。下面给出一个示例代码,实现脚本控制VideoNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VideoNode }) public video: Laya.VideoNode; constructor() { super(); } // 组件被激活后执行,此时所有节...

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

13. 弹窗视图组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

...7) 保存场景后,在RuntimeScript.ts中添加如下代码: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.c...

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

14. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 88%]

...创建好了UI组件脚本,而后添加的代码如下所示: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button...

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

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

...型,用于常规的资源 */}); 完整的脚本示例如下: const { regClass, property } = Laya; @regClass() export class LoaderDemo extends Laya.Script { onAwake(): void { this.loadTexture("resources/image/monkey2.png", 500);//需要在resources/image放入相应的资源 this.loadTexture("htt...

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

16. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 88%]

...。下面给出一个示例代码,实现脚本控制SoundNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件...

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

17. 2.2.0beta3版本的UI库中,WXOpenDataViewer没有注册 [ 86%]

...要在class WXOpenDataViewer类定义后加上代码:     Laya.ILaya.regClass(WXOpenDataViewer);     Laya.ClassUtils.regClass("laya.ui.WXOpenDataViewer", WXOpenDataViewer);     Laya.ClassUtils.regClass("Laya.WXOpenDataViewer", WXOpenDataViewer); 2019-08-13 添加评论 免费帖 --> ...

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

18. 图像组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 86%]

...中。下面给出一个示例代码,实现脚本控制Image: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Image }) public img: Laya.Image; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组...

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

19. 进度条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

...,用于描述加载进度。需要添加如下的示例代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ProgressBar }) public progressBar: Laya.ProgressBar; @property({ type: Laya.Text }) public loadText: Laya.Text; //...

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

20. 列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 84%]

...置数据源 必须要在代码中给List组件设置数据源。 const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEna...

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