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

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

51. js socket 连接不上 [ 62%]

....init(800,600,Laya.WebGL); // var socket = io.connect('10.10.1.103:8081'); this.byte = new Laya.Byte(); this.byte.endian = Laya.Byte.LITTLE_ENDIAN; this.socket = new Laya.Socket(); this.socket.endian = Laya.Byte.LITTLE_ENDIAN; //建立连接 this.socket.connectByUrl("ws://10.10.1.103:8888"); // this...

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

52. 关于如何解析远程.xml文件的问题 [ 62%]

...Laya.loader.load("http://192.168.1.21:90/Game_Config.xml",Handler.create(this,onLoadered)); public function onLoadered(data:*):void { trace("data:" + data); }  来完成文件的加载,在文件加载完会返回xml的内容信息,这是你可以解析加载的xml内容 2016-11-20 0 0 分享 ...

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

53. socket无法连接服务器 [ 62%]

...eDistconnected;         private initSocket(): void {             this.on(Laya.Event.OPEN, this, this.onConected);             this.on(Laya.Event.ERROR, this, this.onError);         }         public conectToServer(): void { //“连接”按钮的回调             if (t...

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

54. 如何在laya中直接使用proto中定义的enum? [ 60%]

...rotoBuf:any = Browser.window.protobuf;     ProtoBuf.load("type.proto", this.onProtoLoaded);     ProtoBuf.load("Lobby/protobuf/client2world_protocol.proto", this.onProtoBufLoaded1); } function onProtoLoaded(err:any, root:any):void{     if (err)         throw err;     root_prot...

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

55. 从网络上下载的BMP图片二进制数据后,如何赋值给 laya.ui.Image [ 59%]

...new laya.net.HttpRequest();         req.on(laya.events.Event.COMPLETE, this, cb_onSuccess);         req.on(laya.events.Event.ERROR, this, cb_onFail);         req.send(url);      }      // 下载jpg图片成功后,显示在舞台上,response为 bmp图片二进制     function ...

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

56. socket大型项目回调 [ 59%]

... = console.log; console.warn = console.log; console.error = console.log; } this._message = new Message(); this._package = new Package(); this.socket = null; this.callbacks = {}; this.handlers = {}; // Map from request id to route this.routeMap = {}; this.heartbeatInterval = 0; this.heartbeatTimeout ...

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

57. 多线程worker(TypeScript-2D进阶篇(TS)-游戏加载策略) [ 58%]

...要的资源 Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; ``` `WorkerLoader.workerPath = "libs/worker.js";...

来源: Laya2.0_文档 发布时间: 20210715

58. 在native下 Laya.Browser.window.Blob不存在 [ 57%]

...ion (ss) { var xhr = new Laya.HttpRequest(); xhr.once(Laya.Event.COMPLETE, this, completeHandler); xhr.once(Laya.Event.ERROR, this, errorHandler); xhr.send("http://192.168.10.108:35553/re ... ot%3B, "", "get", "arraybuffer"); function completeHandler(data) { //加载完成返回的data是arraybuffer...

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

59. 和原生Dom交互 · LayaAir3.3 · 引擎文档 · LAYABOX [ 57%]

...代码如下: var div:any = Laya.Browser.document.createElement("div"); this.qrcode = new Laya.Browser.window.QRCode(div,{ width:100, height:100 }); var url:string = "http://layabox.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite()...

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

60. 多线程worker(JavaScript-2D进阶篇(JS)-游戏加载策略) [ 55%]

...要的资源 Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,onLoaded)); function onLoaded(){ //实例UI界面 var testView = ui.test.TestPageUI(); Laya.stage.addChild(testView); } ``` `WorkerLoader.workerPath = "libs/worker.js";`设置worker.js的路径,这个worker.js是Laya官...

来源: Laya2.0_文档 发布时间: 20210715