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

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

141. 引擎的text类中有没有直接读取Json文件的函数 [ 53%]

...ader.JSON); } private function onLoaded():void { var json:JSON=Laya.loader.getRes("unpack.json"); var str:String=JSON.stringify(json); trace(str); } } } 2017-08-07 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 youngas 相关问题 看...

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

142. 如何实现类似AS3下的BitmapData.draw去截取区域图片? [ 53%]

...:void         {             var texture:Texture=Laya.loader.getRes("walk.png");             //计算好UV,创建新的texture             var texEnd:Texture=Texture.create(texture,240,248,120,118);             //将新的texture放置到display容器下,...

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

143. 请问一下,怎么将下面这段AS3代码翻译成LayaAir的API [ 52%]

...onLoaded)) } private function onLoaded():void { var texture:Texture=Loader.getRes('res/apes/monkey2.png'); var sp:Sprite=new Sprite(); var matrix:Matrix=new Matrix(); matrix.rotate(Math.PI/4); matrix.translate(150,100); sp.graphics.drawTexture(texture,0,0,texture.width,texture.height,matrix); sp.gra...

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

144. 问一下这个问题要怎么改啊? [ 52%]

...showBgImg():void { pic = new Image(); pic.graphics.drawTexture(Laya.loader.getRes(picUrl), picX, picY); Laya.stage.addChild(pic); } } }   Main.as package { import laya.display.*; import laya.resource.Texture; import laya.ui.Image; import laya.utils.Handler; import addPic; public class Main { privat...

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

145. TypeError: Cannot read properties of null (reading '_$id') [ 52%]

...fined错误 laya2.6.0打apk小游戏都会报_InPool为null Load.loader.getRes返回都是Null 莫名其妙的报错,this.getStyle()是null Error processing "launch": Error: 找不到文件: null 请设置文件配置文件属性runtimeExecutable 求助大佬,同一个spine动画播放偶尔...

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

146. LayaNative端使用.ttf字体 [ 52%]

...FER); } private function onLoaded():void { var arr:ArrayBuffer=Laya.loader.getRes("hu.ttf"); if(Browser.window.conch) { Browser.window.conch.setFontFaceFromBuffer("hu",arr); } var text:Text=new Text(); text.font="hu"; text.fontSize=50; text.text="哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈...

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

147. 如何获取animation的node节点? [ 52%]

...建一个用于存放位图数组的临时精灵 let texture = Laya.loader.getRes(options.srcPath+options.srcName+".png"); // 读取图集生成大切片 let textureIns = Laya.Texture.create(texture, aniProps.res[aniProps.mc[options.srcName].frames[i].res].x, aniProps.res[aniProps.mc[options.srcName...

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

148. 游戏系怎么把一些共用的功能独立出来 [ 51%]

...(this, this.onLoading, null, false)); 3、注入JSvar js:any = Laya.loader.getRes("res/atlas/choujiang.js"); Browser.window.eval(js); 4、运行JS var ChouJiang = Browser.window.eval("模块名+类名"); var choujiang:any =  new ChouJiang(); choujiang.play(); 2018-05-25 0 1 分享 微博 QZONE 微...

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

149. 个人笔记:失焦或静音状态下播放背景音乐无效的解决方案 [ 51%]

...return null; } }; var tSound; if (!Browser.onMiniGame){ tSound=Laya.loader.getRes(url); } if (!soundClass)soundClass=SoundManager._soundClass; if (!tSound){ tSound=new soundClass(); tSound.load(url); if (!Browser.onMiniGame){ Loader.cacheRes(url,tSound); } }; var channel; channel=tSound.play(startTi...

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

150. 图集打包后使用Texture不显示啊 [ 51%]

... //Laya.stage.screenMode = "vertical"; var texture:Texture = Laya.loader.getRes("start/sg.png"); var sp = new Laya.Sprite(); sp.graphics.drawTexture(texture,300,300); Laya.stage.addChild(sp); var ani: Laya.Animation = new Laya.Animation(); ani.loadAtlas("res/start.json"); // 加载图集动画 ani.i...

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