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

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

121. 程序当中更改适配模式后,没有生效成相对应的适配模式效果是为什么? [ 80%]

...tageHeight = Laya.Browser.clientHeight; if (stageWidth < stageHeight) { console.log("one", Laya.stage.scaleMode) Laya.stage.scaleMode = Laya.Stage.SCALE_NOSCALE; //1 console.log("one1", Laya.stage.scaleMode) } else { console.log("two", Laya.stage.scaleMode) Laya.stage.scaleMode = Laya.Stage.SCALE...

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

122. 除了用“+"拼接,如何创建格式化字符串? [ 80%]

... // ES6: var h = 'Hello'; var w = 'World'; var helloWorld = `${h} ${w}`; console.log(helloWorld); // 用在console console.log("%s%d", "one plus one equals ", 2) 2017-10-26 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 jxfcwys 相关问...

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

123. list item 添加事件后无法监听 [ 80%]

...Item);     return list; }  function updateItem(cell, index) {     console.log(index);     // console.log(cell.dataSource);     cell.setImg(cell.dataSource[index]);     cell.on(Laya.Event.CLICK, function() {         console.log("click")     }) }  function onSelect(in...

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

124. 在线急等,发现你们这个编译器一个bug,不能实现负负得正,昨天明明解决了,过了一会又不行了,怎么回事 [ 80%]

...moveDownBall = function(){ this.ball.x -= this.vx; this.ball.y += this.vy; console.log("111111"); this.vy *= 0.99; this.vy += 0.25; console.log("222222"); if (this.ball.y + this.vy >= this.img1 ||this.ball.y + this.vy <= 0) { this.vy = -this.vy; console.log("33333"); } if (this.ball.x + this.v...

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

125. 请问laya2.0 2d物理有射线检测功能吗 [ 80%]

...aya.Physics.I.world world.RayCast(function(fixture,point,normal,fraction){ console.log("fixture",fixture) console.log("point",point) console.log("normal",normal) console.log("fraction",fraction) },{ x:300, y:100 },{ x:300, y:1000 }) //每碰到一个物体就会触发一次回调函数,没碰到...

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

126. 加载-加载序列 [ 80%]

...is, this.onAssetLoaded), null, null, 2, false); } onAssetLoaded(texture) { console.log(texture.url); // 恢复默认并发加载个数。 if (++numLoaded == 3) { Laya.loader.maxLoader = 5; console.log("All done."); } } } new Loader_Sequence();module laya { import Texture = Laya.Texture; import Handl...

来源: Laya2.0_示例 发布时间: 20250222

127. laya的canvas缩放原理? [ 80%]

...     虽然说laya可以通过一些方法获取缩放的参数,例如 console.log(Laya.stage._canvasTransform); console.log(Laya.stage.clientScaleX); console.log(Laya.stage.clientScaleY);   但是,我的div,在laya还没初始化完成的时候,就已经有了吧。这时候,应该无...

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

128. 使用getUserInfo获取的用户信息 [ 80%]

...getUserInfo({ withCredentials:false, lang: 'zh_CN', success: (res) => { console.log(res); // BigData.ins.user = res.data[0]; }, fail: () => { console.log("userInfo"+JSON.stringify("fail")); }, complete: () => { // console.log("userInfo"+JSON.stringify(selfData)); } Res打印出来时空的 ...

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

129. async bug 导出小游戏 [ 80%]

...rmal; share.imageUrl = ShareImgUrl; let a = await share.shareAppMessage(); console.log(a) }   转换后代码   onShareClick() { // return __awaiter(this, void 0, void 0, function* () { // let share = SDKCenter.getShare(); // share.title = ShareNormal; // share.imageUrl = ShareImgUrl; // let a = y...

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

130. 请问laya中js如何继承自己写的类 [ 80%]

...unction t1(b) { this.b = b; } //父类方法a t1.prototype.a = function(){ console.log(this.b.x+""+this.b.y); } return t1; }());   ========================= /* * t2继承父类t1 */ var t2 = (function () { function t2() { t2.super(); } t2.prototype.a = function(){ console.log('2222'); } return t2; ...

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