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

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

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

...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); cons...

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

2. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 99%]

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

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

3. 视频节点 · LayaAir3.0文档 · LAYABOX [ 97%]

...下面给出一个示例代码,实现脚本控制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

4. 列表组件 · LayaAir3.0文档 · LAYABOX [ 97%]

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

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

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

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

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

6. 音频节点 · LayaAir3.0文档 · LAYABOX [ 94%]

...下面给出一个示例代码,实现脚本控制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_文档 发布时间: 20230628

7. 图像组件 · LayaAir3.0文档 · LAYABOX [ 91%]

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

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

8. 多行输入文本组件 · LayaAir3.0文档 · LAYABOX [ 86%]

...示。 (动图1-3) (动图1-4) 1.3 脚本控制TextArea const { regClass, property } = Laya; @regClass() export class TextAreaControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * ...

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

9. 基础文本 · LayaAir3.0文档 · LAYABOX [ 83%]

...结合1.3节的脚本控制,在脚本中输入如下代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Text }) txt: Laya.Text; constructor() { super(); } onAwake(): void { this.txt.text = "...

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

10. 显示文本组件 · LayaAir3.0文档 · LAYABOX [ 78%]

...。下面给出一个示例代码,实现脚本控制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