Packagecom.addicted2flash.util
Classpublic class TextDrawer

This class enables multiple instances to retrieve bitmaps with text.

This can be necessary when the same type of text-style is used in many objects. With this class you can avoid greedy instances of the TextField class.



Public Properties
 PropertyDefined by
  size : Size
Returns the clipping Size of the copy region.
TextDrawer
  textField : TextField
Returns the TextField set to be drawn.
TextDrawer
Public Methods
 MethodDefined by
  
TextDrawer(textField:TextField)
Creates a new TextDrawer.
TextDrawer
  
createBitmap(text:String, pixelSnapping:String = "auto", smoothing:Boolean = false):Bitmap
Creates an returns a Bitmap with the copied text in it.
TextDrawer
  
createBitmapData(text:String):BitmapData
Creates an returns a BitmapData with the copied text in it.
TextDrawer
  
drawBitmap(bitmap:Bitmap, text:String):void
Draws the text in the given Bitmap.
TextDrawer
  
drawBitmapData(data:BitmapData, text:String):void
Draws the text in the given BitmapData.
TextDrawer
Property detail
sizeproperty
size:Size  [read-write]

Returns the clipping Size of the copy region.

Implementation
    public function get size():Size
    public function set size(value:Size):void
textFieldproperty 
textField:TextField  [read-write]

Returns the TextField set to be drawn.

Implementation
    public function get textField():TextField
    public function set textField(value:TextField):void
Constructor detail
TextDrawer()constructor
public function TextDrawer(textField:TextField)

Creates a new TextDrawer.

Parameters
textField:TextField — the textField to copy
Method detail
createBitmap()method
public function createBitmap(text:String, pixelSnapping:String = "auto", smoothing:Boolean = false):Bitmap

Creates an returns a Bitmap with the copied text in it.

Parameters
text:String — text to be copied
 
pixelSnapping:String (default = "auto") — pixel snapping
 
smoothing:Boolean (default = false) — smoothing

Returns
Bitmap — a Bitmap with the copied text in it
createBitmapData()method 
public function createBitmapData(text:String):BitmapData

Creates an returns a BitmapData with the copied text in it.

Parameters
text:String — text to be copied

Returns
BitmapData — a BitmapData with the copied text in it
drawBitmap()method 
public function drawBitmap(bitmap:Bitmap, text:String):void

Draws the text in the given Bitmap.

Parameters
bitmap:BitmapBitmap
 
text:String — text to be copied
drawBitmapData()method 
public function drawBitmapData(data:BitmapData, text:String):void

Draws the text in the given BitmapData.

Parameters
data:BitmapDataBitmapData
 
text:String — text to be copied