大约有 55 项符合查询结果, 库内数据总量为 30,900 项。 (搜索耗时: 0.0028 秒)
...ivate translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { // 平移cube this.cube.transform.translate(this.translate, false); } } 效果如图1-1...
来源: Laya3.0_文档 发布时间: 20240910
...lass TestBluePrint extends Laya.Script { constructor(testParams: string) { super(); } } (图12-1) 3.2 属性 在变量前使用装饰器的标识@bpProperty,在get和set前使用装饰器的标识@bpAccessor,示例代码如下所示: const { bpClass, bpAccessor, bpProperty } = BP; @bpClass...
来源: Laya3.0_文档 发布时间: 20250103
...ya.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_label: "No." + m })...
来源: Laya3.0_文档 发布时间: 20240910
...aContextView }) public opendata: Laya.OpenDataContextView; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.opendata.pos(100,100); this.opendata.size(500,500); } } 2. 代码创建OpenDataCon...
来源: Laya3.0_文档 发布时间: 20240910
...ty({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.sound.source = "resources/sound.wav"; //音频路径 this.sound.loop = 0; //循环...
来源: Laya3.0_文档 发布时间: 20240910
...ty({ type: Laya.VideoNode }) public video: Laya.VideoNode; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 鼠标点击触发播放 Laya.stage.on(Laya.Event.MOUSE_DOWN, () => { Laya.loader.load(...
来源: Laya3.0_文档 发布时间: 20250103
... { @property({ type: Laya.Image }) public img: Laya.Image; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.img.skin = "resources/layaAir.png";//设置皮肤 this.img.useSourceSize = true;//...
来源: Laya3.0_文档 发布时间: 20240910
... { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtarea.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 t...
来源: Laya3.0_文档 发布时间: 20240910
...a.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; //在定时器中让变量page每次...
来源: Laya3.0_文档 发布时间: 20240910
...@property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this....
来源: Laya3.0_文档 发布时间: 20240910