Type Reference

Type TBitmapFont Defines a bitmap font

The TBitmapFont object works from BMF Files, which are created using a tool called BitmapFontEd available at http://www.noddybox.demon.co.uk/free/index-csharp.html
Note that when colours are referenced they simply modify the colours in the font images as SetColor() would do on a norml image.
When drawing characters the current scale, alpha and rotation settings are applied.


Method DrawColoured( txt:String, x:Int, y:Int, red:Int, green:Int, blue:Int ) Draws coloured text.

Draws txt at the supplied x,y co-ordinates. red,green and blue control the colour.



Method Draw( txt:String, x:Int, y:Int ) Draws white text.

Draws txt at the supplied x,y co-ordinates in white.



Method CentreColoured( txt:String, y:Int, red:Int, green:Int, blue:Int ) Draws centred, coloured text.

Draws txt centred at the supplied y co-ordinate. red,green and blue control the colour.



Method Centre( txt:String, y:Int ) Draws centred, white text.

Draws txt centred at the supplied y co-ordinate in white.



Method TextWidth:Int( txt:String ) Width of the supplied string.

Returns: The length of the string txt in pixels.

The current scale settings are taken into account.



Method TextHeight:Int( txt:String ) Height of the supplied string.

Returns: The height of the string txt in pixels.

The current scale settings are taken into account.



Method MaxWidth:Int() Width of the largest character.

Returns: The width in pixels of the largest character in the font.



Method MaxHeight:Int() Height of the largest character.

Returns: The height in pixels of the largest character in the font.



Function Load:TBitmapFont( path:String, image_flags:Int ) Loads a font from the supplied BMF file.

Returns: The created font, or null if the BMF file couldn't be loaded.

The image_flags are passed onto CreateImage() when the images for the font are being created.




Module Information

Framework Simple Bitmap Font Routines
Copyright Public Domain
Author Ian Cowburn
Version $Revision$