summaryrefslogtreecommitdiff
path: root/bitmapfont.mod/doc/commands.html
blob: d196db5abb1bfda427c5de2f7dc2c643e053c8ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<title>BlitzMax Module Reference</title>
<link rel="stylesheet" type="text/css" href="../../../../doc/bmxstyle.css">
</head>
<body>
<h1>Type Reference</h1>
<p><div id=TBitmapFont class=ref>
<div class=rootdoc><font class=token>Type TBitmapFont</font> Defines a bitmap font</div><div class=indent><p>The <b>TBitmapFont</b> object works from BMF Files, which are created using a tool called BitmapFontEd available at
<a href="http://www.noddybox.demon.co.uk/free/index-csharp.html">http://www.noddybox.demon.co.uk/free/index-csharp.html</a><br>
Note that when colours are referenced they simply modify the colours in the font images as <b>SetColor</b>() would do on a norml image.<br>
When drawing characters the current scale, alpha and rotation settings are applied.</div><br><p><div id=DrawColoured>
<div class=rootdoc><font class=token>Method DrawColoured( txt:String, x:Int, y:Int, red:Int, green:Int, blue:Int )</font> Draws coloured text.</div><div class=indent><p>Draws <b>txt</b> at the supplied <b>x</b>,<b>y</b> co-ordinates.  <b>red</b>,<b>green</b> and <b>blue</b> control the colour.</div><br></div><br>
<p><div id=Draw>
<div class=rootdoc><font class=token>Method Draw( txt:String, x:Int, y:Int )</font> Draws white text.</div><div class=indent><p>Draws <b>txt</b> at the supplied <b>x</b>,<b>y</b> co-ordinates in white.</div><br></div><br>
<p><div id=CentreColoured>
<div class=rootdoc><font class=token>Method CentreColoured( txt:String, y:Int, red:Int, green:Int, blue:Int )</font> Draws centred, coloured text.</div><div class=indent><p>Draws <b>txt</b> centred at the supplied <b>y</b> co-ordinate.  <b>red</b>,<b>green</b> and <b>blue</b> control the colour.</div><br></div><br>
<p><div id=Centre>
<div class=rootdoc><font class=token>Method Centre( txt:String, y:Int )</font> Draws centred, white text.</div><div class=indent><p>Draws <b>txt</b> centred at the supplied <b>y</b> co-ordinate in white.</div><br></div><br>
<p><div id=TextWidth>
<div class=rootdoc><font class=token>Method TextWidth:Int( txt:String )</font> Width of the supplied string.</div><div class=indent><p><b>Returns:</b> The length of the string <b>txt</b> in pixels.<p>The current scale settings are taken into account.</div><br></div><br>
<p><div id=TextHeight>
<div class=rootdoc><font class=token>Method TextHeight:Int( txt:String )</font> Height of the supplied string.</div><div class=indent><p><b>Returns:</b> The height of the string <b>txt</b> in pixels.<p>The current scale settings are taken into account.</div><br></div><br>
<p><div id=MaxWidth>
<div class=rootdoc><font class=token>Method MaxWidth:Int()</font> Width of the largest character.</div><div class=indent><p><b>Returns:</b> The width in pixels of the largest character in the font.</div><br></div><br>
<p><div id=MaxHeight>
<div class=rootdoc><font class=token>Method MaxHeight:Int()</font> Height of the largest character.</div><div class=indent><p><b>Returns:</b> The height in pixels of the largest character in the font.</div><br></div><br>
<p><div id=Load>
<div class=rootdoc><font class=token>Function Load:TBitmapFont( path:String, image_flags:Int )</font> Loads a font from the supplied BMF file.</div><div class=indent><p><b>Returns:</b> The created font, or null if the BMF file couldn't be loaded.<p>The <b>image_flags</b> are passed onto <b>CreateImage</b>() when the images for the font are being created.</div><br></div><br>
</div><br>
<h1>Module Information</h1>
<table>
<tr><td><b>Framework</b></td>
<td> Simple Bitmap Font Routines</td></tr>
<tr><td><b>Copyright</b></td>
<td> Public Domain</td></tr>
<tr><td><b>Author</b></td>
<td> Ian Cowburn</td></tr>
<tr><td><b>Version</b></td>
<td> $Revision$</td></tr>
</table>
</body>
</html>