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

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

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

... false, delay, caller, method, args, coverBefore); } 使用示例如下: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { //60帧后,图片的透明度变为0.5 Laya.time...

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

2. 视频节点 · LayaAir3.0文档 · LAYABOX [ 93%]

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

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

3. UI滤镜效果 · LayaAir3.0文档 · LAYABOX [ 93%]

...种: 1、使用ColorFilter类直接创建滤镜,示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组...

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

4. 资源加载 · LayaAir3.0文档 · LAYABOX [ 93%]

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

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

5. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 92%]

...定义之前使用装饰器的标识@bpClass,示例代码如下所示: const { bpClass } = BP; @bpClass({ name:"TestBluePrint", canInherited: true, extends:"Script" }) export class TestBluePrint extends Laya.Script { } 需要注意的是,只有注册了构造函数,才可以在蓝图编辑...

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

6. 显示文本组件 · LayaAir3.0文档 · LAYABOX [ 90%]

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

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

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

...方体,在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,...

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

8. 组件装饰器说明 · LayaAir3.0文档 · LAYABOX [ 87%]

...义之前使用装饰器的标识@regClass(),示例代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 如动图1-1所示,只有使用了上述的这个装饰器标识,开发者自定义的组件脚本才会被IDE识别为组件,可以被...

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

9. 开放数据域组件 · LayaAir3.0文档 · LAYABOX [ 86%]

...下面给出一个示例代码,实现脚本控制OpenDataContextView: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.OpenDataContextView }) public opendata: Laya.OpenDataContextView; constructo...

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

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

...动图1-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, () => ...

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