大约有 38 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0031 秒)
2.0引擎开发者使用3.0的差异汇总1、LayaAir3.0 Loader修改1.1加载一个资源1.2 加载多个资源(用数组)1.3 加载多个文件(组合)1.5 加载HTMLImage1.6 使用Options。1.7 预制体/场景的问题1.8 旧版本引擎load和create的兼容性问题1.9扩展Loader能...
来源: Laya3.0_文档 发布时间: 20251010
...和使用窗口: let win = new GWindow(); win.contentPane = ((await Laya.loader.load("Examples/windows/Window1.lh")) as Laya.Prefab).create(); window.show(); 也可以扩展GWindow类使用: class MyWindow extends Laya.GWindow { protected onInit() { this.contentPane = ((await Laya.loader.load("E...
来源: Laya3.0_文档 发布时间: 20251010
...例如节点被添加到舞台后 onEnable(): void { // 加载资源 Laya.loader.load("resources/spritelight.png", Laya.Loader.IMAGE).then(() => { this.setSpriteLight(); this.setDirectLight(); this.setBackground(); }); } // 配置精灵灯光 setSpriteLight(): void { this.spriteLight.pos(100,350)...
来源: Laya3.0_文档 发布时间: 20251010
...组件均已创建完毕,此方法只执行一次 onAwake(): void { Laya.loader.load(this.skin).then( ()=>{ this.onColorPickerSkinLoaded(); } ); } private onColorPickerSkinLoaded(e: any = null): void { let colorPicker: Laya.ColorPicker = new Laya.ColorPicker(); colorPicker.selectedColor = "#ff0...
来源: Laya3.0_文档 发布时间: 20251010
...此方法只执行一次 onAwake(): void { //加载Spine动画资源 Laya.loader.load("resources/boy/spineboy-pma.skel").then(() => { //添加spine组件 this.spine = this.sprite.addComponent(Laya.Spine2DRenderNode); this.spine.source = "resources/boy/spineboy-pma.skel"; this.spine.animationName ...
来源: Laya3.0_文档 发布时间: 20250104
...Start() { console.log("Game start"); //加载内置骨骼动画资源 Laya.loader.load("skeleton/Dragon/Dragon.sk").then((templet: Laya.Templet) => { //创建模式为1,可以启用换装 this.mArmature = templet.buildArmature(0); this.mArmature.x = 300; this.mArmature.y = 350; this.mArmature.s...
来源: Laya3.0_文档 发布时间: 20251010
...加载进度条资源,图片资源来自“引擎API使用示例” Laya.loader.load(["resources/res/ui/progressBar.png", "resources/res/ui/progressBar$bar.png"]).then(() => { // 创建进度条 this.progressBar = new Laya.ProgressBar("resources/res/ui/progressBar.png"); this.progressBar.pos(10...
来源: Laya3.0_文档 发布时间: 20251010
...使用的方式为: let myI18n: Laya.Translations; myI18n = await Laya.loader.load("editorResources/i18nSettings.i18ns"); console.log(myI18n.t("a")); 在很多情况下,如果只是代码里用到的一些小量国际化的支持,并不想创建多个json文件,那么也有全代码的方法...
来源: Laya3.0_文档 发布时间: 20251010
...用后执行,例如节点被添加到舞台后 onEnable(): void { Laya.loader.load(this.backgroundTexture).then(() => { this.createLightOccluder(); this.createSpotLight(); this.createBackground(); }); } // 创建2D光遮挡器 createLightOccluder(): void { this.lightOccluder.pos(233, 265); this...
来源: Laya3.0_文档 发布时间: 20251010
...件均已创建完毕,此方法只执行一次 */ onAwake(): void { Laya.loader.load(this.skin).then( ()=>{ this.onLoadComplete(); } ); } private onLoadComplete(e: any = null): void { let ta: Laya.TextArea = new Laya.TextArea(""); ta.skin = this.skin; ta.font = "Arial"; ta.fontSize = 18; ta.bol...
来源: Laya3.0_文档 发布时间: 20251010