diff options
Diffstat (limited to 'bitmapfont.mod/bitmapfont.bmx')
-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 |