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

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

161. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 54%]

... Texture; set texture(value: Texture); 我们来看看代码示例: Laya.loader.load("atlas/comp/image.png").then(() => { let sprite = new Laya.Sprite(); //精灵设置纹理并居中显示 let res = Laya.loader.getRes("atlas/comp/image.png"); sprite.pos(Laya.stage.width >> 1, Laya.stage....

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

162. 无法触发浏览器文件上传框 [ 54%]

...n: string = 'images/button.png'; constructor() { Laya.init(200, 300); Laya.loader.load(this.skin, Laya.Handler.create(this, () => { this.btn = this.createBtn(this.skin); this.btn.on(Laya.Event.CLICK, this, this.onClick); })); } /** * 创建btn */ private createBtn(skin: string): Laya.Button { let...

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

163. Clip属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 53%]

...HOWALL; //背景颜色 Laya.stage.bgColor = "#232628"; //加载资源 Laya.loader.load([buttonSkin, clipSkin, bgSkin], laya.utils.Handler.create(this,onSkinLoaded)); } /***加载资源完成***/ private function onSkinLoaded(e:*=null):void { //显示背景图 showBg(); //创建计数器 createCounte...

来源: Laya2.0_文档 发布时间: 20210714

164. 预制体模块 · LayaAir3文档 · LAYABOX [ 53%]

... constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label ); } ); } } 运行效果如图3-6所示 (图3-...

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

165. 预制体 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

... constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label ); } ); } } 运行效果如图3-6所示 (图3-...

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

166. 内置骨骼动画 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

...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

167. tiledmap有时尺寸不正确 [ 52%]

...件 private _mTiledMap:TiledMap = null; // 自定义信息文件 private _mLoader:Loader = null; // 当前地图X坐标 private _mViewPortX:number = 0; // 当前地图Y左边 private _mViewPortY:number = 0; // 当前加载状态 private _mLoadState:ESceneLoadState = ESceneLoadState.eLoadNull; // 地...

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

168. 【简单跑酷--JS版】---Lv.5 玩家踩地板 [ 52%]

... Math.random()); if(this.bg == null){ //贴图纹理 this.bgTexture = Laya.loader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); this.addChild(this.bg); //因为上面的图片是截取的 所以右边可能没有图片了 这里补一个 this.rightBg = new l...

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

169. Skeleton骨骼动画内存泄漏 [ 52%]

...ure2d destory"); } this.bitmap=null; } if (this.url && this===Laya.loader.getRes(this.url)) Laya.loader.clearRes(this.url); } }增加的代码是 if (this.bitmap.referenceCount===0){ this.bitmap.destroy(); // console.log("texture2d destory"); } 2019-06-13 0 0 分享 微博 QZONE 微信 打...

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

170. 2.12.2beta1 诸多bug [ 51%]

...,因为loadImage为异步,而在image的skin更换皮肤时,可以从loader里使用getRes加载到texture,但此时texture还未加载完成,所以导致source._bitmap为null,无法显示的问题,这个问题目前我们没有较好的解决方案,只能使用预加载或在loadIma...

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