大约有 13 项符合查询结果, 库内数据总量为 30,900 项。 (搜索耗时: 0.0038 秒)
...ke(): void { let sprite = new Laya.Sprite(); // 添加到舞台 Laya.stage.addChild(sprite); } 3.2 显示图片 图片的显示是游戏开发的基础,Sprite类中用于显示图片是 Sprite.loadImage 和 Sprite.texture。 3.2.1 loadImage /** * <p>加载并显示一个图片。相当于加...
来源: Laya3.0_文档 发布时间: 20250103
... private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHandler(e: any = null): void { this.onLoaded(); } } 编译运行代码,效果如图3-3所示,说明地图已创建成功。 (图3-3) 3.3...
来源: Laya3.0_文档 发布时间: 20240910
...label.stroke = STROKE_WIDTH; label.strokeColor = strokeColor; } this.owner.addChild(label); return label; } } 效果预览: (图2-1) Copyright ©Layabox 2025 all right reserved,powered by LayaAir Engine更新时间: 2024-09-10 16:27:03 img{cursor:pointer}
来源: Laya3.0_文档 发布时间: 20240910
...bg.width >> 1, Laya.stage.height - bg.height >> 1); this.owner.addChild(bg); } private createTimerAnimation(): void { this.counter = new Laya.Clip(this.clipSkin, 10, 1); this.counter.autoPlay = true; this.counter.interval = 1000; this.counter.x = (Laya.stage.width - this.counter.width) /...
来源: Laya3.0_文档 发布时间: 20240910
...gressBar.changeHandler = new Laya.Handler(this, this.onChange); this.owner.addChild(this.progressBar); Laya.timer.loop(100, this, this.changeValue); }); } // 模拟进度条加载 private changeValue(): void { if (this.progressBar.value >= 1) this.progressBar.value = 0; this.progressBar.value += ...
来源: Laya3.0_文档 发布时间: 20240910
...本组件 this.text = new Laya.Text(); this.text.pos(300, 260); this.owner.addChild(this.text); // 滚动条皮肤资源 var skins: any[] = []; skins.push("atlas/comp/hscroll.png", "atlas/comp/hscroll$bar.png", "atlas/comp/hscroll$down.png", "atlas/comp/hscroll$up.png"); Laya.loader.load(skins).then...
来源: Laya3.0_文档 发布时间: 20240910
...本组件 this.text = new Laya.Text(); this.text.pos(300, 260); this.owner.addChild(this.text); // 滚动条皮肤资源 var skins: any[] = []; skins.push("atlas/comp/vscroll.png", "atlas/comp/vscroll$bar.png", "atlas/comp/vscroll$down.png", "atlas/comp/vscroll$up.png"); Laya.loader.load(skins).then...
来源: Laya3.0_文档 发布时间: 20240910
...elSize = 20; radio.labelBold = true; radio.labelVAlign = "top"; this.owner.addChild(radio); } } 效果如动图2-1所示: (动图2-1) Copyright ©Layabox 2025 all right reserved,powered by LayaAir Engine更新时间: 2024-09-10 16:27:03 img{cursor:pointer}
来源: Laya3.0_文档 发布时间: 20240910
...,item4,item5"); ComboBox.labelSize = 30; ComboBox.itemSize = 25 this.owner.addChild(ComboBox); ComboBox.autoSize = true; ComboBox.pos(200, 200); }); } } Copyright ©Layabox 2025 all right reserved,powered by LayaAir Engine更新时间: 2024-09-10 16:27:03 img{cursor:pointer}
来源: Laya3.0_文档 发布时间: 20240910
...ex); tab.selectHandler = new Laya.Handler(this, this.onSelect); this.owner.addChild(tab); return tab; } private onSelect(index: number): void { console.log("当前选择的标签页索引为 " + index); } } 运行效果如下动图所示: (动图2-1) Copyright ©Layabox 2025 all right reserved...
来源: Laya3.0_文档 发布时间: 20240910