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

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

161. laya底层的加载为什么可以new两次 [ 69%]

...可以new两次 laya.net.Loader.as  第222行 new HTMLImage.create(url, {onload: onload, onerror: onerror, onCreate: function(img:*):void { image = img; //增加引用,防止垃圾回收 imgCache[url] = img; }}); 这里的调用create本身就是返回一个对象了,为什么这里还能在new...

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

162. 分享:LayaAir下如何获取图集下的小图资源? [ 69%]

...[{url:"res/atlas/atlas_res.json",type:Loader.ATLAS}], Handler.create(this, onLoaded)); } private function onLoaded():void { //获取图集下的单张小图 var texture:Texture=Laya.loader.getRes("atlas_res/01.png"); var sp:Sprite=new Sprite(); sp.graphics.drawTexture(texture,200,100); Laya.stage.ad...

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

163. layaair2.2 ide版本新建的空项目,开启调试模式后报错了 [ 69%]

...d property 'enable' of undefined preload.js:55 at HTMLScriptElement.script.onload (file:///E:/h5/project/szfy2.2/bin/libs/laya.core.js:22121:39)   TypeError: Cannot read property 'enable' of undefined laya.core.js:22121 at HTMLScriptElement.script.onload (file:///E:/h5/project/szfy2.2/bin/libs/laya...

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

164. 在微信小游戏中使用BitmapFont会导致报错. [ 69%]

...      Laya.loader.load("res/atlas/comp.atlas", Handler.create(null, onLoaded));     })); }  function onLoaded(): void {     //实例UI界面     var testUI: TestUI = new TestUI();     Laya.stage.addChild(testUI); } 附件 : --> src.rar 2018-05-09 添加评论 免费帖 --> 分...

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

165. 位图字体不显示 [ 69%]

...同来自: this.mBitmapFont.loadFont( "ziti.fnt", new Laya.Handler( this, onLoaded ) );   上面的 "ziti.fnt" 路徑錯誤,需寫完整路徑。   Example : 假設fnt檔案跟png檔案都放在res資料夾底下,那你就應該寫這樣。   this.mBitmapFont.loadFont( "res/ziti.fnt", new Lay...

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

166. 模仿教程里的打地鼠写的代码,运行报错 [ 69%]

...载资源 Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS) })(); function onLoaded(){ //实例化 var tempBG=new background(); Laya.stage.addChild(tempBG); } })();在background.js里是这样写的 var background = (function (_super) { function backg...

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

167. Panel使用文档(JavaScript-IDE篇(JS)-IDE组件属性详解) [ 69%]

...资源 Laya.loader.load("res/atlas/comp.atlas", Laya.Handler.create(this, onLoaded)); function onLoaded() { //实例化Panel组件 var panel = new Laya.Panel(); //给panel添加背景色 panel.graphics.drawRect(0, 0, 100, 100, "#ffcccc"); //给panel设置宽高 panel.size(100, 100); //给panel设置...

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

168. CheckBox属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 69%]

...背景色 Laya.stage.bgColor = "#ffffff"; //加载图集成功后,执行onLoad回调方法 Laya.loader.load([skin1,skin2], Handler.create(this, onLoaded)); } private function onLoaded():void { //创建一个CheckBox实例cb1 var cb1:CheckBox = new CheckBox(skin1); //添加到舞台上显示 Laya.s...

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

169. LayaNative端使用.ttf字体 [ 69%]

...aya.stage.bgColor="#EEFFCC"; Laya.loader.load("hu.ttf",Handler.create(this,onLoaded),null,Loader.BUFFER); } 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()...

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

170. 微信小游戏的位图字体加载报错! [ 69%]

...t t.e.parseFont (http://127.0.0.1:63921/game/code.js:1:12413)     at e.s.onLoaded (http://127.0.0.1:63921/game/code.js:1:176642)     at e.u (http://127.0.0.1:63921/game/code.js:1:295812)     at Image._image._image.onload (http://127.0.0.1:63921/game/code.js:1:481938) 2018-05-30 添加评论 ...

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