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

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

101. 在微信分享成功的回调函数里,Laya播放音效失败。 [ 74%]

...o.visible = true; gameex.bar.destoyRankSprite()  this.nCountDown = 15; // console.log(gameex.snakeSelf) } })     //暂停 GameEx.prototype.pause = function () { console.log("停止播放音乐") Laya.SoundManager.stopMusic(); //停止游戏主循环 Laya.timer.clear(this, this.onLoop); //移除...

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

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

...谢谢?   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

103. 布局后的对象的x y坐标如何获取? [ 74%]

...了centerX 和centerY后,就无法获取到这个Box的坐标了呀? console.log(this.test1.x ) //结果是 0  但console.log 这个对象,可以看到_x _y 的坐标   请问如何获取到这个被布局后的x y坐标呀? 附件 : --> 2019-07-01 添加评论 免费帖 --> 分享 ...

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

104. 不带格式后缀的图片无法成功加载 [ 73%]

...aya.Handler.create(this, () => { let picTemp = Laya.Loader.getRes(url); console.log(picTemp.width) // undefined let nodee = new Laya.Sprite() nodee.texture = picTemp nodee.width = 500 nodee.height = 250 nodee.x = 100 nodee.y = 350 Laya.stage.addChild(nodee) }));上面这个图片无法正常显...

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

105. [LayaAirIDE3]Laya.loader.on(Event.ERROR, this, this.onError) 无法侦听到加载资源失败 [ 73%]

...ate onAssetLoaded(): void     {         // 使用texture         console.log("加载结束");     }      // 加载进度侦听器     private onLoading(progress: number): void     {         console.log("加载进度: " + progress);     }      private onError(err: string):...

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

106. [LayaAir3]Pool对象池获取继承对象时会返回基类对象 [ 73%]

... Laya.Script { onStart() { let item1 = Laya.Pool.createByClass(TestClass); console.log('item1:', item1.type); Laya.Pool.recoverByClass(item1); let item2 = Laya.Pool.createByClass(TestClass2); console.log('item2:', item2.type); console.log(item1 == item2); } } export class TestClass { type = 0; } exp...

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

107. HTMLCanvas Laya.stage.addChild(HTMLCanvas); 挂载到舞台报错 [ 73%]

...);      div.size(600,400);      Laya.stage.addChild(div);      console.log(div);  var myChart = echarts.init(div.getCanvas());  // 指定图表的配置项和数据 var option = { title: { text: 'ECharts 入门示例' }, tooltip: {}, legend: { data:['销量'] }, xAxis: { data: ["衬衫...

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

108. 子容器的事件问题 [ 73%]

...(vhvt); vhvt.on(laya.events.Event.CLICK, this, (event: Laya.Event) => { console.log("为什么这里不进来"); }); } /**  * ViewHeadViewTest  */ class ViewHeadViewTest extends Laya.Sprite {     constructor() {         super();         this.graphics.drawRect(0, 0, 1500, 1500, "#0000f...

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

109. 国际化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 73%]

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

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

110. Button 添加事件不执行? [ 73%]

... clickHandler); rightBtn.clickHandler = Handler.create(this, function () { console.log('click handler'); }); function clickHandler () { console.log('on click') } Stage.addChild(rightBtn);  请问一下,为什么事件不执行啊? 2018-03-09 添加评论 免费帖 --> 分享 微博 QZONE 微信...

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