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

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

11. socket无法连接服务器 [ 88%]

...         this.state_ = EConnectionState.eConnected;             console.log("conect to 127.0.0.1");         }         protected _onMessage(msg: any): void {             super._onMessage(msg);             console.log("receve msg : ");             console.log(msg); ...

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

12. Laya2.6.0 升级至Laya2.8.0 Native环境 加载ttf 字体不生效 [ 88%]

...        if (!success) {                     console.error("OPPOSANS-R ttf 字体加载失败");                 } else {                     console.log("OPPOSANS-R ttf 字体加载成功");                 }  ...

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

13. Tween.to 执行失败 [ 88%]

...行失败  //使精灵走到鼠标位置 function walkToMousePos(sprite){ console.log(Laya.stage.mouseX) ; console.log(Laya.stage.mouseY) ; console.log(sprite.x) ; console.log(sprite.y) ; var hDir = Laya.stage.mouseX>sprite.x? "right" : "left" ; var vDir = Laya.stage.mouseY>sprite.y? "down" :...

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

14. websocket请教下,服务器发送过来的数据怎么获取 [ 87%]

...过来的数据怎么获取 private openHandler(event: any = null): void { console.log(`平台 正确建立连接`); this.socket.send("getScore"); } private receiveHandler(msg: any = null,data): void { console.log(`接收到数据触发函数:` + msg); ///////////////////////////////////////////////...

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

15. VSCODE高效再+1,自动刷新 [ 87%]

...s = exec("layaair2-cmd compile"); process.stdout.on("data", (data) => { console.log(data); }); process.stderr.on("data", (data) => { console.error(data); }); process.on("exit", (code, signal) => { console.log("success"); // console.log(code, signal); // 编译结束,触发reload,浏览...

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

16. getimagedata直接调用无法获取有效像素问题 [ 87%]

...(200, 0);             x = t.getPixels(0,0,400,400)             console.log(x)             for (let i of x) {                 if (i > 0) {                     console.log(i)                 }             }             console.log(' ----- 到...

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

17. 三个图好像无法绑定不同的事件? [ 87%]

... Laya.stage.addChild(img1); img1.on(Laya.Event.CLICK,this, function(name){ console.log(name);},['图1']); var img2 = new Laya.Sprite(); img2.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/apes/monkey2.png',200,300,90,90); Laya.stage.addChild(img2); img2.on(Laya.Event.CLICK,this, function(nam...

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

18. dialog 里的数据已经获取到了,也赋值了但是页面没跟新,addChild好像无效果 [ 87%]

...d: { skin: 'comp/food' + foodid + '.png' }, food_txt: { text: foodtxt } // console.log(); } } console.log('+++++++++++++++++++') console.log(_super); console.log(fooddata); self.foodList.dataSource = fooddata;  //实例化角色容器 var foodBox = new Laya.Sprite(); //添加到舞台上 console.lo...

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

19. 如何在游戏入口处获取对象的子对象 [ 87%]

...ed = function(){ this.pass = this.map.getLayerByIndex(0);//获取通行层 console.log(this.pass); } _proto.getLayer = function() { this.floor = this.map.getLayerByIndex(0);//获取通行层 console.log(this.pass); } console.log(this.map) return loadMap; })(Sprite);**游戏主入口** var Main = (fu...

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

20. list只能显示一个图片 [ 86%]

...) { var item = {pic:{skin:'cards/'+i+'tong.jpg'}}; this.data.push(item); } console.log(this.data); this.list1.dataSource = this.data; this.list1.x = 50; this.list1.y = 500; this.list1.getChildAt(0).height = 100; this.list1.vScrollBarSkin = ""; this.list1.hScrollBarSkin = "comp/hscroll.png"; this.lis...

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