GODPAPER | All Packages | All Classes | Index | Frames No Frames |
BitmapChar

Package | starling.text
Class | public class BitmapChar
Inheritance | BitmapChar Object

A BitmapChar contains the information about one char of a bitmap font. You don't have to use this class directly in most cases. The TextField class contains methods that handle bitmap fonts for you.

Public Properties

| Property | Defined By
--- | --- | ---
|  | charID : int [read-only] The unicode ID of the char. | BitmapChar
|  | height : Number [read-only] The height of the character in points. | BitmapChar
|  | texture : Texture [read-only] The texture of the character. | BitmapChar
|  | width : Number [read-only] The width of the character in points. | BitmapChar
|  | xAdvance : Number [read-only] The number of points the cursor has to be moved to the right for the next char. | BitmapChar
|  | xOffset : Number [read-only] The number of points to move the char in x direction on character arrangement. | BitmapChar
|  | yOffset : Number [read-only] The number of points to move the char in y direction on character arrangement. | BitmapChar

Public Methods

| Method | Defined By
--- | --- | ---
|  | BitmapChar(id:int, texture:Texture, xOffset:Number, yOffset:Number, xAdvance:Number) Creates a char with a texture and its properties. | BitmapChar
|  | addKerning(charID:int, amount:Number):void Adds kerning information relative to a specific other character ID. | BitmapChar
|  | createImage():Image Creates an image of the char. | BitmapChar
|  | getKerning(charID:int):Number Retrieve kerning information relative to the given character ID. | BitmapChar

Property Detail

charID | property

`charID:int` [read-only]

The unicode ID of the char.

Implementation
`public function get charID():int`

height | property |

`height:Number` [read-only]

The height of the character in points.

Implementation
`public function get height():Number`

texture | property |

`texture:Texture` [read-only]

The texture of the character.

Implementation
`public function get texture():Texture`

width | property |

`width:Number` [read-only]

The width of the character in points.

Implementation
`public function get width():Number`

xAdvance | property |

`xAdvance:Number` [read-only]

The number of points the cursor has to be moved to the right for the next char.

Implementation
`public function get xAdvance():Number`

xOffset | property |

`xOffset:Number` [read-only]

The number of points to move the char in x direction on character arrangement.

Implementation
`public function get xOffset():Number`

yOffset | property |

`yOffset:Number` [read-only]

The number of points to move the char in y direction on character arrangement.

Implementation
`public function get yOffset():Number`
Constructor Detail

BitmapChar | () | Constructor

`public function BitmapChar(id:int, texture:Texture, xOffset:Number, yOffset:Number, xAdvance:Number)`

Creates a char with a texture and its properties.

Parameters

| `id:int`
| `texture:Texture`
| `xOffset:Number`
| `yOffset:Number`
| `xAdvance:Number`

Method Detail

addKerning | () | method

`public function addKerning(charID:int, amount:Number):void`

Adds kerning information relative to a specific other character ID.

Parameters

| `charID:int`
| `amount:Number`

createImage | () | method |

`public function createImage():Image`

Creates an image of the char.

Returns

| `Image`

getKerning | () | method |

`public function getKerning(charID:int):Number`

Retrieve kerning information relative to the given character ID.

Parameters

| `charID:int`

Returns

| `Number`

Thu Jan 16 2014, 01:11 PM +08:00