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

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

231. 微信工具Js的Function问题 [ 73%]

...w Function(args[0], args[1], args[2]); var t = Function.apply(null, args); console.log( f(1,3) ); console.log( t(1,3) ); 这两个函数在Layabox开发时的目的都是生成一个不确定参数的函数,但导出到微信时Function会调用到其它函数中,请问怎么解决:   附件 ...

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

232. sound manager在MOUSE_OVER事件中无法播放 [ 73%]

...    private onPlayMusic(e: Event): void {             console.log("播放音乐");             SoundManager.playMusic("../../res/sounds/bgm.mp3", 1, new Handler(this, this.onComplete));         }          private onPlaySound(e: Event): void { ...

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

233. 当使用代码创建打开场景时,onOpened触发了,但场景active和activeInHierarchy还是处于false,请问纯代码怎么实现场景创建激活,谢谢 [ 73%]

...谢谢?   const scene = new Laya.Scene(); scene.onOpened = () => { console.log('scene onOpened'); }; scene.open(); console.log('scene', scene.active, scene.activeInHierarchy); Laya.timer.frameOnce(10, this, () => {   console.log('scene 2', scene.active, scene.activeInHierarchy); });   日...

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

234. 淘宝创意互动发布指南(TypeScript-小游戏适配文档-淘宝创意互动) [ 73%]

...s,a.js 和 b.js ```javascript //a.js 中的内容: var a = function(){ console.log("a") } //b.js 中的内容: var b = function(){ console.log("b") } ``` 然后我们引用 js,调用2个方法,在 H5 上是可以正常输出内容的。 ```javascript require("a.js") require("b.js") a(); //...

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

235. 获取的ui页面里下on事件无法触发 [ 73%]

...meStartView.super(this); this.Start.on(Laya.Event.CLICK, this, this.open); console.log(this.Start); GameStartView.prototype.open = function(){ console.log("Open is ok"); } }; Laya.class(GameStartView,"GameStartView", GameStartUI); 输出:Button {toggle: false, _bitmap: AutoBitmap, _text: Text, _st...

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

236. protobuf的bytes字段的问题 [ 73%]

...ode(loginReq).finish(); var de_loginProto= LoginReqCls.decode(loginProto); console.log('c : ' + de_loginProto['channel']); console.log('a : ' + de_loginProto['msg']); 输出结果是: c : 2 a : undefined 为什么 呢? msg为空?   2017-11-05 添加评论 免费帖 --> 分享 微博 QZONE 微...

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

237. LayaAir 如何读取资源中的txt文件中的内容 [ 73%]

...何读取资源中的txt文件中的内容 var testPath ="res/Test.txt"; console.log( Laya.loader.load(testPath)); console.log(Laya.Loader.getRes(testPath)); 这里打印的是 LoaderManager {retryNum: 1, retryDelay: 0, maxLoader: 5, _loaders: Array(4), _loaderCount: 1…} undefined 并不是文本...

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

238. EventDispatcher接收不到参数 [ 73%]

...r(); //发送事件 Dispatcher.Emit = function(InName,agv){ //派发事件 console.log("agv-->"+agv); Dispatcher.eventDispatcher.event(InName,agv); } //侦听事件 Dispatcher.AddNotice = function(InName,caller,listener,arg){ //监听事件 Dispatcher.eventDispatcher.on(InName,caller,listener,(ar...

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

239. 国际化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 72%]

...ns; myI18n = await Laya.loader.load("editorResources/i18nSettings.i18ns"); console.log(myI18n.t("a")); 在很多情况下,如果只是代码里用到的一些小量国际化的支持,并不想创建多个json文件,那么也有全代码的方法。 //第一个参数需要全局唯一 let myI18...

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

240. 循环监听按钮,如何进行传参和接受参数 [ 72%]

...ypeBox.getChildByName('btn' + i) as Laya.Image;               console.log(e); e.on(Laya.Event.CLICK, this, this.onBtnClick); }   按钮事件 private onBtnClick(event:Laya.Event): void {         let b = event.currentTarget as Laya.Image; console.log('onClickLevel > ' + b.ski...

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