文本缓存器,用于解决fillText渲染过慢的问题,该API只适用于HTML5

Constructor

@:value({ color : 0xffffff })new (id:String, fontName:String, fontsize:UInt, color:UInt = 0xffffff)

Variables

@:value(false)cacheAutoWrap:Bool = false

缓存字是否进行换行,换行可能会减少杂点的情况,但是渲染的字数将会大大下降,默认为false。

Methods

dispose ():Void

释放缓存文本占用的纹理

getAtlas ():TextureAtlas

获取文本渲染精灵表

Returns:

TextureAtlas

setFontColor (color:Int):Void

更新字体颜色

Parameters:

null

color

setFontSize (size:Int):Void

设置字体大小

Parameters:

null

size

set_text (value:String):String

计算并生成出精灵表

Parameters:

value

Returns:

String

Inherited Variables

Defined by HTML5CacheTextFieldBitmapData

bitmapData:BitmapData

@:value("")drawText:String = ""

@:value(0)drawTime:Int = 0

@:value(0)height:Int = 0

id:String

@:value(false)isZh:Bool = false

@:value(1)line:Int = 1

@:value(false)mouseEnabled:Bool = false

@:value(false)selectable:Bool = false

text:String

@:value(0)width:Int = 0

@:value(false)wordWrap:Bool = false

Inherited Methods

Defined by HTML5CacheTextFieldBitmapData

@:has_untypeddisposeSelf ():Void

@:value({ isEmoj : false })getCharBoundaries (index:Int, isEmoj:Bool = false):Rectangle

setTextFormat (format:TextFormat):Void