diff options
| author | Ian C <ianc@noddybox.co.uk> | 2005-07-22 22:59:50 +0000 |
|---|---|---|
| committer | Ian C <ianc@noddybox.co.uk> | 2005-07-22 22:59:50 +0000 |
| commit | a0ea730f4028df72eb2c13b1275a2d6511c013d0 (patch) | |
| tree | 39629a40e3968d2e86265f78a691c22e4b8e95c0 | |
| parent | 53e432db41f2a62009e264b7b85397df2957b5bd (diff) | |
Added TextHeight
| -rw-r--r-- | bitmapfont.mod/bitmapfont.bmx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitmapfont.mod/bitmapfont.bmx b/bitmapfont.mod/bitmapfont.bmx index 4c78c73..67bcd1f 100644 --- a/bitmapfont.mod/bitmapfont.bmx +++ b/bitmapfont.mod/bitmapfont.bmx @@ -115,4 +115,17 @@ Type BitmapFont Return w End Method + Method TextHeight:Int(txt:String) + Local h:Int=0 + Local xs#,ys# + + GetScale(xs,ys) + + For Local f=0 Until Len(txt) + h=Max(h,height[txt[f]-32]*ys) + Next + + Return h + End Method + End Type |
