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

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

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

...对齐且最后一行有数字“1”时排版不正常,发现是 getTextWidth( ) 函数的结果和在屏幕上实际显示的宽度不同导致。 2018-04-17 1 0 分享 微博 QZONE 微信 he853066732 赞同来自: 先上源码  module game { /** * 富文本类型(重写Text类的排版和渲...

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

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

...ER: string = "center"; constructor(jsonData: any,textureData: Laya.Texture,width: number,posType:string = "left"){ super(); this.width = width; this._posType = posType; this._jsonData = jsonData; this._imageData = textureData; } public set padding(v: number){ this._padding = v; this.setCharsPos(); }...

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

3. Laya引擎bug [ 97%]

...     if (needWordWrapOrTruncate){             var wordWrapWidth=this.getWordWrapWidth();         }         if (this._currBitmapFont){             this._charSize.width=this._currBitmapFont.getMaxWidth();             this._charSize.height=this._...

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

4. 为什么laya的Button渲染逻辑顺序是先渲染,再获取素材切片? [ 96%]

...his._skin); if (!img){ console.log("lose skin",this._skin); return; }; var width=img.sourceWidth; var height=img.sourceHeight / this._stateNum; img.$_GID || (img.$_GID=Utils.getGID()); var key=img.$_GID+"-"+this._stateNum; var clips=AutoBitmap.getCache(key); if (clips)this._sources=clips; else { thi...

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

5. SVG渐变精灵的扩展脚本继承了多个精灵, 在safari环境下重叠了渲染 [ 96%]

...9/xlink" version="1.1" ';             data += 'viewBox="0 0 ' + this.width + ' ' + this.height + '" ';             // set svg width and height             data += 'width="' + this.width + '" height="' + this.height + '">';             data += '<defs>';          ...

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

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

...atic fontPool: Laya.Sprite = ; /** * * @param resFix 资源前缀 * @param width 宽度 * @param align 水平排列方式 * @param padding 间距 */ public constructor(resFix: string, width: number, align: string = "left",padding: number=0) { super(); this.width = width; this.resFix = resFix; this._...

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

7. 【LIST无法拖动】参照官方实例做的 [ 95%]

...ngbang.text = "已获得关卡";         paihangbang.x = (list.width - paihangbang.fontSize * 3) / 2;         console.info(list.x + "---"+list.y + "---"+paihangbang.x + "---"+paihangbang.y + "---")         paihangbang.y -= (paihangbang.fontSize + 20);  ...

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

8. 分包后, 资源加载问题 [ 95%]

...eView(loadingjzaUI.uiView); } loadingjzaUI.uiView={"type":"View","props":{"width":192,"height":269},"compId":1,"child":[{"type":"Image","props":{"y":0,"x":0,"skin":"loading/dt_jza_loadtuan_zj.png"}},{"type":"Box","props":{"y":0,"x":0},"child":[{"type":"Image","props":{"y":0,"x":0,"width":192,"skin":...

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

9. 关于缓动函数from的一些问题记录 [ 95%]

...r letterText = new Laya.Text(); letterText.text ="hello world"; letterText.width = 400; letterText.height = 200; letterText.fontSize = 36; letterText.align = "center"; letterText.valign = "middle"; var offsetPos={offsetX:100,offsetY:100}; letterText.x = Laya.stage.width - letterText.width>>1 +...

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

10. ???????? 为啥加一个 Text,drawcall 暴增? [ 91%]

...ngth = String(price).length; var w = length * 16 + 15 + 40; fish.scoreItem.width = w; fish.scoreItem.x = fish.getBox().x - fish.scoreItem.width/2; fish.scoreItem.y = fish.getBox().y - fish.scoreItem.height; this.scoreBox.addChild(fish.scoreItem); fish.scoreGold = new Laya.Image(); fish.scoreGold.ski...

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