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

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

811. 预加载结束之后还是报lose skin [ 60%]

预加载结束之后还是报lose skin private loadRes():void{ Laya.loader.load("./res/atlas/comp.atlas",Laya.Handler.create(this, this.onAssetLoaded),Laya.Handler.create(this, this.onLoading, null, false)); } private onLoading(progress: number): void { console.log("加载进度: " + progress); } ...

来源: Laya_社区 发布时间: 20180314

812. list里面可以加入多个view吗? [ 60%]

...放置view,写了个例子,可以参考下:package { import laya.net.Loader; import laya.ui.List; import laya.ui.View; import laya.utils.Browser; import laya.utils.Handler; public class LayaAirDemo { private var list:List; public function LayaAirDemo() { Laya.init(Browser.width,Browser.height)...

来源: Laya_社区 发布时间: 20170626

813. 分享:如何用代码创建自定义Tab组件 [ 60%]

...bgColor="#EEFFCC"; //预加载button的资源,用于tab的项皮肤 Laya.loader.load("button-4.png",Handler.create(this,onLoaded)); } private function onLoaded():void { //添加tab容器 var tab:Tab=new Tab(); Laya.stage.addChild(tab); for(var i:int=0;i<6;i++)//为tab容器添加button { var bt...

来源: Laya_社区 发布时间: 20170626

814. 如何预先下载资源到本地,laya里面又怎么引用已下载的资源文件?路径要怎么设置? [ 60%]

...怎么调用下载到本地的资源 cuixueying • 2017-05-18 17:10 Laya.loader.load可以对服务器的资源进行预加载,并缓存到本地,Laya.loader.getRes可以获取缓存下的资源文件! 我盼乙卯 • 2018-05-31 15:42 @cuixueying:请问这个缓存到本地是缓存到硬盘...

来源: Laya_社区 发布时间: 20170319

815. [LayaAir3]OPPO小游戏下图片地址无法加载 [ 60%]

...j.com/api/player/auth/img?key=testpng oppo小游戏下 无法显示  Laya.loader .load( "https://sh.mudgj.com/api/playe ... ot%3B, Laya.Loader.IMAGE ) .then((res: Laya.Texture) => { let sp = new Laya.Sprite(); sp.texture = res; sp.pos(0, 200); this.addChild(sp); });无法正常显示 检查发...

来源: Laya_社区 发布时间: 20250818

816. 输入设备-指南针 [ 60%]

...tage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(compassImgPath, Handler.create(this, this.init)); } init() { const Gyroscope = Laya.Gyroscope, Event = Laya.Event; // 创建罗盘 this.createCompass(); // 创建方位指示器 this.createDirectionIndicator(); //...

来源: Laya2.0_示例 发布时间: 20251209

817. 弹窗视图组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 59%]

...nMouseClick(): void { //使用Prefab,需要转换根节点为Dialog Laya.loader.load("resources/Prefab2D.lh").then(res => { let dlg: Laya.Dialog = res.create(); dlg.open(); }); } } 运行效果如下: (动图) 二、通过代码创建Dialog 在进行书写代码的时候,免不了通过...

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

818. demo中的2d和3d混合 加载ktx的资源 会白色的 其他ui没有问题 [ 59%]

...00631用户 赞同来自:    //加载IDE指定的场景         Laya.loader.load([{url:"minastc.config.json",type:Laya.Loader.JSON}],new Laya.Handler(this,function(){             this.astcconfig = Laya.loader.getRes("minastc.config.json");             for(var key in this.astcconfig...

来源: Laya_社区 发布时间: 20221013

819. [LayaAir3]3.0版本资源销毁后_referenceCount不会变成0,2.0版本是正常的可以变为0 [ 59%]

...后_referenceCount不会变成0,2.0版本是正常的可以变为0 Laya.loader.load('resources/UI/role/mxxxx.png', Laya.Loader.IMAGE).then((res: Laya.Texture) => { let sp = new Laya.Sprite(); sp.texture = res; Laya.stage.addChild(sp); setTimeout(() => { sp.destroy() }, 1000); });重现代码...

来源: Laya_社区 发布时间: 20231130

820. image.drawToCanvas方法获取的一直是空的png [ 59%]

...tage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load("res/logo.png",Handler.create(this,onLoaded)); } private function onLoaded():void { img=new Image(); img.skin="res/logo.png"; Laya.stage.addChild(img); Laya.timer.once(500,this,onClick); //Laya.stage.on(Event.CLIC...

来源: Laya_社区 发布时间: 20170704