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

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

41. list只能显示一个图片 [ 88%]

...) { 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

42. 事件管理 · LayaAir3.0文档 · LAYABOX [ 88%]

...LICK 的(以下代码来自“2D入门示例”): onEnable(): void { console.log("IndexRT onEnable") //侦听ui按钮点击事件 this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开UI场景示例 console.log("uiBtn"); Laya.Scene.open("scenes/UiMain.ls"); }); //侦听物理按...

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

43. 加载-错误处理和进度 [ 88%]

...nt.ERROR, this, this.onError); } onAssetLoaded(texture) { // 使用texture console.log("加载结束"); } // 加载进度侦听器 onLoading(progress) { console.log("加载进度: " + progress); } onError(err) { console.log("加载失败: " + err); } } new Loader_ProgressAndErrorHandle();module laya...

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

44. 最新版本IDE,如何获取http返回的json数据 [ 87%]

... //注册按钮响应函数 Login.prototype.onButtonLogin = function (){ console.log ('按了登录按钮')  var xhr = new Laya.HttpRequest(); xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.once(Event.PROG...

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

45. 关于多点触控e.touches问题 [ 87%]

...rlMoveRockerTouchDown);     function onCtrlMoveRockerTouchDown(e) {    console.log("onCtrlMoveRockerTouchDown()");    this.ctrlMoveRockerPosX = undefined;    this.ctrlMoveRockerPosY = undefined;    var tX, tY;    var ts = e.touches;    console.log(e.stageX + ":" + e.stageY);    if(ts...

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

46. Laya.Pool.getItemByClass 闪退 [ 87%]

...s 闪退 var fish:CFFish = Laya.Pool.getItemByClass(type,CFFish) as CFFish console.log(fish) fish.visible = true fish.init(type) 调用init方法时候闪退,错误信息是 "fish.init is not a function" "TypeError: fish.init is not a function at Function.CFSprite.reusableFishWithType (file:///Use...

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

47. 获取位置信息 · LayaAir3.0文档 · LAYABOX [ 87%]

...r.create(this, this.onSuccess), Laya.Handler.create(this, this.onError) ); console.log("click"); } // 成功获取位置后触发 onSuccess(info: Laya.GeolocationInfo): void { console.log('经纬度: (' + info.longitude + '°, ' + info.latitude + '°),精确度:' + info.accuracy + 'm'); if (info...

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

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

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

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

49. 各位大佬,帮我看看 tiledMap 中获取不到自定义属性 [ 86%]

... var data = this.tiledMap.getLayerByIndex(3).getTileData(tileX, tileY); // console.log(data) // console.log(Laya.Keyboard.RIGHT) switch (e.keyCode) { //右边 case 39: { this.player.x += 16 break; } case 37: { //左边 this.player.x -= 16 break; } case 38: { //上 this.player.y -= 16  break; } case...

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

50. Laya.MiniAdpter.downLoadFile缓存的文件无法读取的问题 [ 86%]

...存二进制文件,逻辑如下:   public Request(url:string):void { console.log("url: " + url); if (Laya.Browser.onMiniGame) { var args = {url:url, handler:null}; var handler = Laya.Handler.create(this, this.OnDownloadFileInWxOk, [args], false); args.handler = handler; Laya.MiniAdpter.downLoad...

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