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

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

1. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 100%]

...nst { bpClass } = BP; @bpClass({ name:"TestBluePrint", canInherited: true, extends:"Script" }) export class TestBluePrint extends Laya.Script { } 需要注意的是,只有注册了构造函数,才可以在蓝图编辑器的createNew中创建这个类的实例,如图12-1所示。 const { bpClas...

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

2. UI滤镜效果 · LayaAir3.0文档 · LAYABOX [ 95%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { //创建...

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

3. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 95%]

... 下面是一个推荐做法: //Script.ts @Laya.regClass() class Script extends Laya.Script { wantToUseNode() { EditorEnv.scene.runScript("TestSceneScript.visitNode"); } } //TestSceneScript.ts import fs from "fs"; //注意是IEditorEnv.regClass,不是Laya.regClass!! @IEditorEnv.regClass() class ...

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

4. UI运行时 · LayaAir3.0文档 · LAYABOX [ 92%]

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUSE_DOWN, this, ()=>{ this.Image.visible = false; }); } } 其次,可以在Scene2D节点下添加...

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

5. 弹窗视图组件 · LayaAir3.0文档 · LAYABOX [ 90%]

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close(); }); } } 1.3.3 关联场景 设置好弹窗之后,需要用代码将Dialog与所需要用到该Dialog的场景...

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

6. 列表组件 · LayaAir3.0文档 · LAYABOX [ 89%]

...。 const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array<any&gt...

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

7. 进度条组件 · LayaAir3.0文档 · LAYABOX [ 84%]

... 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_文档 发布时间: 20230921

8. 垂直布局容器组件 · LayaAir3.0文档 · LAYABOX [ 80%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VBox }) public vbox: Laya.VBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.vbox.pos(100, 100); this....

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

9. 水平布局容器组件 · LayaAir3.0文档 · LAYABOX [ 80%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.HBox }) public hbox: Laya.HBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.hbox.pos(100, 100); this....

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

10. 图像组件 · LayaAir3.0文档 · LAYABOX [ 80%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Image }) public img: Laya.Image; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): vo...

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