大约有 212 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0053 秒)
Laya_社区(127) Laya3.0_api(22) Laya3.0_文档(17) Laya2.0_文档(16) Laya_示例(12) Laya2.0_示例(12) laya_api(3) Laya2.0_api(3)
... 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
...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
...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
... 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
... 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
...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
...件 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
... 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
...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
...,因为loadImage为异步,而在image的skin更换皮肤时,可以从loader里使用getRes加载到texture,但此时texture还未加载完成,所以导致source._bitmap为null,无法显示的问题,这个问题目前我们没有较好的解决方案,只能使用预加载或在loadIma...
来源: Laya_社区 发布时间: 20211105