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

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

1. 场景管理 · LayaAir3.4 · 引擎文档 · LAYABOX [ 100%]

... Laya.Script { @property({ type: Laya.Button }) public uiBtn: Laya.Button; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开Ms...

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

2. 音频节点 · LayaAir3.4 · 引擎文档 · LAYABOX [ 99%]

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

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

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

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

4. 视频节点 · LayaAir3.4 · 引擎文档 · LAYABOX [ 95%]

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

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

5. 插件开发说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 92%]

...egClass() export class DemoPreviewPlugin extends IEditorEnv.AssetPreview { constructor() { super(); this.sprite.graphics.drawCircle(100, 100, 50, "#ffff00"); this.sprite.size(100, 100); } async setAsset(asset: IEditorEnv.IAssetInfo): Promise<any> { this.renderTarget = this.sprite; } } 显示...

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

6. 3D变换 · LayaAir3.4 · 引擎文档 · LAYABOX [ 89%]

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

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

7. 列表组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 88%]

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

8. 显示文本组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 81%]

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

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

9. 弹窗视图组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 81%]

...N_PADDING: number = 5; private assets: any[]; private dialog: Laya.Dialog; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 图片资源来自“引擎API使用示例” this.assets = ["resources/re...

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

10. 基础文本 · LayaAir3.4 · 引擎文档 · LAYABOX [ 79%]

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