From a0ea730f4028df72eb2c13b1275a2d6511c013d0 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 22 Jul 2005 22:59:50 +0000 Subject: Added TextHeight --- bitmapfont.mod/bitmapfont.bmx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit v1.2.3