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

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

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

... 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { // 平移cube this.cube.transform.translate(this.translate, false); } }...

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

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

..."type": "string" } ] } }) export class TestBluePrint extends Laya.Script { constructor(testParams: string) { super(); } } (图12-1) 3.2 属性 在变量前使用装饰器的标识@bpProperty,在get和set前使用装饰器的标识@bpAccessor,示例代码如下所示: const { bpClass, bpAcc...

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

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

...cript extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array<any> = []; for (var m: number = 0; m < 20; m++) { data.push({ m_lab...

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

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

...pe: Laya.OpenDataContextView }) public opendata: Laya.OpenDataContextView; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.opendata.pos(100,100); this.opendata.size(500,500); } } 2. 代码...

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

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

...prite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.sound.source = "resources/sound.wav"; //音频路径 this.sound.lo...

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

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

...Script { @property({ type: Laya.VideoNode }) public video: Laya.VideoNode; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 鼠标点击触发播放 Laya.stage.on(Laya.Event.MOUSE_DOWN, () => { L...

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

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

...ends Laya.Script { @property({ type: Laya.Image }) public img: Laya.Image; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.img.skin = "resources/layaAir.png";//设置皮肤 this.img.useSour...

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

8. 对象池 · LayaAir3.0文档 · LAYABOX [ 86%]

...f (instance) { var className: string = instance["__className"] || instance.constructor._$gid; if (className) Pool.recover(className, instance); } } 有了这两种对应的方式,我们可以不用在代码中去关心每个对象的创建和回收,只关心对象的内部逻辑就好了。比...

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

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

...te3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtarea.pos(Laya.stage.width >> 1, Laya.stage.height >&gt...

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

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

...lare owner : Laya.Sprite3D; @property({ type: Laya.Text }) txt: Laya.Text; constructor() { super(); } onAwake(): void { this.txt.text = "第{n=1}页"; //显示文本的初始化内容 } onStart(): void { let page: number = 1; Laya.timer.frameLoop(10, this, () => { page += 1; //在定时器中让...

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