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

大约有 21 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0030 秒)

1. Laya.Loader.getRes请教 [ 100%]

...r.create(this, this.createView)); 在createView回调里面调用 let tex: Texture = Laya.Loader.getRes("image/shake_01.png"); 想拿图集中的某一张图片。发现拿不到这张图片。 但是我换个默认的图集Laya.loader.load("res/atlas/comp.atlas", Handler.create(this, this.createVie...

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

2. 代码创建精灵监听不到事件? [ 96%]

...件? var boxstr = "ui/buildsmall.png"; var box = new Laya.Sprite(); var texture = Laya.loader.getRes(boxstr); box.graphics.drawTexture(texture); var arr = {data: StorageRoom.map_storageData[0][0],tag:0}; box.on(Laya.Event.MOUSE_UP,this,this.onclick,[arr]);   var _proto = StorageUILayer.prototype;...

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

3. 分享:改变图片皮肤,保持图片原样宽高显示 [ 93%]

...on onClick():void { image.skin="bg.jpg"; } } }方法2:使用graphics.drawTexture的方式】 package { import laya.display.Sprite; import laya.events.Event; import laya.net.Loader; import laya.resource.Texture; import laya.utils.Handler; public class LayaAirDemo { private var sp:Sprite; public fun...

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

4. 关于Laya.loader.load和getRes的问题 [ 89%]

...下是原文的代码,也是我疑问的地方:// 方法2:使用drawTexture Laya.loader.load("../../../../res/apes/monkey2.png", Handler.create(this, function():void { var t:Texture = Laya.loader.getRes("../../../../res/apes/monkey2.png"); var ape:Sprite = new Sprite(); ape.graphics.drawTextur...

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

5. texture 的销毁问题,,,, [ 86%]

texture 的销毁问题,,,, 加载一张图片,然后获取texture var texture = Laya.loader.getRes(url); 然后texture调用texture.destroy(true); 销毁图片, 那下次要使用该图片的时候,还需要重新加载吗,,  是不是我下次使用的时候,我可以直接...

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

6. Laya.loader.load 教程代码出错 [ 85%]

...ay.Sprite;     import laya.utils.Handler;     import laya.resource.Texture;     public class LayaSample {         private var img:Sprite ;         private var index:int ;         public function LayaSample() {             //初始化引擎       ...

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

7. Laya中Button等组件lose skin的问题 [ 85%]

...     var clips=WeakObject.I.get(key);         if (!Utils.isOkTextureList(clips)){             clips=null;         }         if (clips)this._sources=clips;         else {             this._sources=;             if (this._stateNu...

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

8. Sprite-屏幕截图 [ 83%]

...; this.aimSp = null; this.drawImage = null; this.drawSp = null; this.monkeyTexture = null; // 不支持WebGL时自动切换至Canvas Config.preserveDrawingBuffer =true; Laya.init(Browser.clientWidth, Browser.clientHeight); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTE...

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

9. 加载的nativeimage处理 [ 82%]

...LoadComplete)); } private function onSkinLoadComplete(e:*=null):void { var texture:Texture=Loader.getRes("ui/image.png"); var sp:Sprite=new Sprite(); sp.graphics.drawTexture(texture); Laya.stage.addChild(sp); } 2017-06-03 0 1 分享 微博 QZONE 微信 xiaojun 赞同来自: 是这个 2017-06-03 0 0 ...

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

10. 设置遮罩(JavaScript-LayaAir基础篇(JS)-位图) [ 81%]

...代码如下: ```javascript (function() { var Sprite = Laya.Sprite; var Texture = Laya.Texture; var Handler = Laya.Handler; var Res; var img; (function() { Laya.init(1136,640); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" //资源路径 Res = "res/img/monkey1.png"; //先加载图片资...

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