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

大约有 40 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0046 秒)

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

...rtCharsByAlign(align: string): void { let alignConfig = XUtils.TEXT_ALIGN; switch (align) { case alignConfig.CENTER: this.sortOnCenter(); break; case alignConfig.RIGHT: this.sortOnRight(); break; case alignConfig.LEFT: default: this.sortOnLeft(); break; } } /** * 排列字符(适合从左到右)...

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

32. 【简单跑酷--JS版】---Lv.6 终篇 [ 43%]

...ht = 21; var texture1 = Laya.loader.getRes("res/hp_bg.png"); var texture2; switch (type) { case Hp.HP_TYPE_ENERGY: texture2 = Laya.loader.getRes("res/en_bar.png"); break; case Hp.HP_TYPE_SPEED: texture2 = Laya.loader.getRes("res/hp_bar.png"); break; } this.bg = new Sprite(); this.bar = new Sprite();...

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

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

....addChild(charSp); return charSp; } // 设置位置 private setCharsPos(){ switch (this._posType){ case BPFont.LEFT: this.setCharsPosOnLeft(); break; case BPFont.RIGHT: this.setCharsPosOnRight(); break; case BPFont.CENTER: this.setCharsPosOnCenter(); break; } } // 左对齐 private setCharsPosOnLeft...

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

34. 批量销毁释放内存(JavaScript-3D基础(JS)-LayaAir3D的内存管理) [ 40%]

... ```typescript function(e:Event) { this._castType++; this._castType %= 2; switch (this._castType) { case 0: (e.target as Button).label = "释放显存"; this.loadScene(); break; case 1: (e.target as Button).label = "加载场景"; if (this._scene)//_scene不为空表示场景已加载完成 this.gar...

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

35. 批量销毁释放内存(ActionScript-3D基础(AS3)-LayaAir3D的内存管理) [ 39%]

...on)) ```typescript function(e:Event):void { _castType++; _castType %= 2; switch (_castType) { case 0: (e.target as Button).label = "释放显存"; loadScene(); break; case 1: (e.target as Button).label = "加载场景"; if (_scene)//_scene不为空表示场景已加载完成 garbageCollection(); b...

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

36. socket大型项目回调 [ 39%]

... for (var name in msg) { if (protos[name]) { var proto:any = protos[name]; switch (proto.option) { case "optional": case "required": buffer.writeArrayBuffer(this.encodeTag(proto.type, proto.tag)); this.encodeProp(msg[name], proto.type, protos, buffer); break; case "repeated": if (!!msg[name] &&a...

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

37. 批量销毁释放内存(TypeScript-3D基础(TS)-LayaAir3D的内存管理) [ 39%]

...cript function(e:Laya.Event):void { this._castType++; this._castType %= 2; switch (this._castType) { case 0: (e.target as Button).label = "释放显存"; this.loadScene(); break; case 1: (e.target as Button).label = "加载场景"; if (this._scene)//_scene不为空表示场景已加载完成 this.ga...

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

38. 【简单跑酷--JS版】---Lv.5 玩家踩地板 [ 38%]

...6), 0, 0, 32, 96); this.rightBg.width = 32; this.addChild(this.rightBg); } switch(type){ case 1: this.rightBg.visible = false; this.bg.graphics.drawTexture(this.bgTexture, 0, 0, 960, 96); break; default: //随机计算一个宽度 当然 最小是3倍 以防难度太难 var _w = 32 * (3 + parseInt(1...

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

39. LayaAir开发笔记(1)五十音图连连看 [ 33%]

...0); Laya.stage.addChild(txt); txt.on(Laya.Event.CLICK, this, function(e) { switch (e.type) { case Laya.Event.CLICK: gameStart(); break; } }); //注册鼠标点击 加入一个显示得分的函数,分数由时间和出错次数决定,这个函数将会在游戏gameStart函数中调用,因为...

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

40. 【经验分享】如何让ts项目支持装饰器语法,以及自动化发布相关的一些东西 [ 27%]

.../ ERROR — 构建时遇到错误 // FATAL — 遇到无可修复的错误 switch (event.code) { case 'START': tS = Date.now(); console.log(`Starting 'rebuild'...`); break; case 'END': console.log(`Finished 'rebuild' after ${((Date.now() - tS) / 1000).toFixed(2)} s`); break; case 'ERROR': case 'FATA...

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