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

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

1. socket大型项目回调 [ 100%]

...ks[event] || []).push(fn); } public request(route, msg, cb) { if(arguments.length === 2 && typeof msg === 'function') { cb = msg; msg = {}; } else { msg = msg || {}; } route = route || msg.route; if(!route) { return; } this.reqId++; if(this.reqId>127){ this.reqId = 1; } var reqId = this.r...

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

2. 分享个用美术资源做位图文本的方法。。。 [ 98%]

...rite",this._childs[k]); } this.removeChildren(); var charTotal: number = v.length; var charSps: any = ; for(var i=0;i<charTotal;i++){ var targetChar = v.substr(i,1); var charData: any = this._jsonData.frames[targetChar]; if(!charData){ console.warn("没有找到对应的字符:" + targetChar); ...

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

3. 分享:图集资源做位图文本的工具类(知道fontclip组件的可以略过了,之前一直没注意到这个组件) [ 98%]

...private createChars(v: string): void { if (!v) { return; } let charNum = v.length; for (let i = 0; i < charNum; i++) { let char = v.charAt(i); let resName = this.getResName(char); let sp: Laya.Sprite = this.getSprite(); let tx = Laya.Loader.getRes(resName); if (!tx) { console.warn(TipConfig.tips....

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

4. Byte writeArrayBuffer的Bug [ 97%]

...yBuffer的Bug     __proto.writeArrayBuffer=function(arraybuffer,offset,length){         (offset===void 0)&& (offset=0);         (length===void 0)&& (length=0);         if (offset < 0 || length < 0)throw "writeArrayBuffer error - Out of bounds";   ...

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

5. emoji表情文字乱码 [ 97%]

...tr){         this._sourceStr=str;         var texLen = str.length;         var idx = -1;         this._words = ;         while (++idx < texLen) {             var character = str.charAt(idx);             var code = str.charCodeAt(idx)...

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

6. ts加密md5码封装 [ 96%]

...map((x: number) => target[index + x]) : [] ) .filter((x: any[]) => x.length > 0); if (markString) result = result.map((x: any[]) => x.join("")) return result; } padding(str: string | any[], length: number, char: string, tail: boolean = true, isArray: boolean = Array.isArray(str)) { let a...

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

7. 引擎 TiledMap 居然不支持图块翻转 [ 96%]

...Sprite;                 for (var i = 0; i < this.aniSpriteArray.length; i++) {                     tAniSprite = this.aniSpriteArray[i];                     tAniSprite.show();                 }             }         }         hide () {         ...

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

8. 3D 鼠标检测 错乱 [ 94%]

....d3.js _update方法为 _update() { var i=0,n=0,j=0,m=0; n=this._eventList.length; var cameras=this._scene._cameraPool; if (n > 0){ for (i=0;i < n;i++){ var e=this._eventList; switch (e.type){ case "mousedown": this._mouseTouchDown(); break ; case "mouseup": this._mouseTouchUp(); break ; case ...

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

9. ide跑没问题,安卓包跑报错 [ 93%]

...Array<Sprite> = [] 被调用的函数 bodyCheck() { if (this.bodyArr.length <= 0) return; if (this.eatBean >= this.bodyBeanNum && this.bodyArr.length < this.bodyMaxNum) { let addBodyNum = Math.floor(this.eatBean / this.bodyBeanNum) let x = this.bodyArr[this.bodyArr.length - 1]...

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

10. 分享,扩展Laya.Text组件实现简单的富文本 [ 92%]

...._text) password = false; var x = 0, y = 0; var end = Math.min(this._lines.length, visibleLineCount + begin) || 1; let color = this.color; let underline = this.underline; let bold = this.bold; for (var i = begin; i < end; i++) { var lines = this.typeLines[i]; var _word; if (this.align == "right")...

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