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

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

181. 自己创建的box作为tab,为啥没有点击事件啊? [ 60%]

...ssetLoaded2), null, Loader.ATLAS); function onAssetLoaded2() {     Laya.class(MyBoot, "MyBootClass", MyPage2UI);     var UI = new MyBootClass();     Laya.stage.addChild(UI); } function MyBoot() {     MyBoot.super(this);     this.MyTab.selectHandler = new Laya.Handler(this, onSelect, null,...

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

182. 微信小游戏,实现监听前后台切换 [ 60%]

...简单的思路,不知道Laya本身是否有解决方案啊  wxhelper.jsclass WXHELPER { constructor () { this._isWxContext = !!window.wx } onShow (callback) { if (!this._isWxContext) return window.wx.onShow(callback) } onHide (callback) { if (!this._isWxContext) return window.wx.onHide(callback)...

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

183. HTMLIframeElement加载html网页的问题 [ 60%]

...ader = laya.net.Loader; import HTMLIframeElement = Laya.HTMLIframeElement; class TestUI extends ui.htmlUI { constructor() { super(); var iHtml: HTMLIframeElement = new HTMLIframeElement(); Laya.stage.addChild(iHtml); iHtml.href = "https://www.baidu.com/"; } } // 程序入口 Laya.init(600, 400); Lay...

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

184. 聊天消息对话框中new一个HTMLDivElement 报错"Illegal constructor",请问这个该怎么处理? [ 60%]

...HTMLDivElement 报错"Illegal constructor",请问这个该怎么处理? class ChatLineView extends Laya.Box{ textfield : any = null; constructor(){ super(); // this.initLineView(); } public initLineView (data) : void { this.pos(0,0); console.log(this.textfield); if (this.textfield == null) { var s...

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

185. Tab组件如何通过js控制选中 [ 60%]

...以出来当前的选项,说明继承没有问题,但是无法更改 class Tab extends TabUI{ constructor() { super() this.zOrder = 1 console.log(this._tab._selectedIndex) //返回1,正常 this._tab._selectedIndex = 0 } } xdkaka • 2017-12-14 17:40 发布肯定是已经发布了的。。。...

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

186. 切换后台时,引擎如何判断是否停止定时器? [ 60%]

...何判断是否停止定时器? 在pc上时,做个简单的测试, class TestUI extends ui.test.TestPageUI {      constructor() {         super();          this.stage.on(Laya.Event.FOCUS, this, this.onFocus);         this.stage.on(Laya.Event.BLUR, this, this.onBlu...

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

187. 使用 addChild 加载界面后,绑定事件报错 [ 60%]

...载场景后报上面图片的错误 GameStart 类如下: export default class GameStart extends ui.GameStartUI {     constructor() {         super();          this.btnStart.on(Laya.Event.CLICK, this, this.startGame);     }      startGame(): void {         //L...

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

188. 两个移动的简单物体 onTriggerEnter 无法触发 (有悬赏) [ 60%]

...体移动时候重合但是无法触发onTriggerEnter,   export default class BulletControlTrigger extends Laya.Script3D { constructor(){ super(); }  /** * 开始触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other){ console.log("onTriggerEnter"); };  on...

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

189. 播放视频只有声音没有图像 [ 60%]

...video这个元素有 let SoundManager = Laya.SoundManager; export default class LoginGame extends Laya.Scene { constructor() { super(); LoginGame.instance = this; Laya.MouseManager.multiTouchEnabled = false; this.loadScene("LoginGame.scene"); } onEnable() { SoundManager.playMusic("audio/梅林茂 - ...

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

190. 在UI类里调用启动类的静态函数失败了 [ 60%]

...用启动类的静态函数失败了 这是我的启动类 // 程序入口 class GameMain { constructor() { Laya.init(600, 400); Laya.stage.bgColor = "#123456"; Laya.loader.load([ { url: "res/beijing/beijing2.png", type: Laya.Loader.IMAGE }, { url: "res/atlas/comp.png", type: Laya.Loader.IMAGE }, { ...

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