summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-07-22 22:59:50 +0000
committerIan C <ianc@noddybox.co.uk>2005-07-22 22:59:50 +0000
commita0ea730f4028df72eb2c13b1275a2d6511c013d0 (patch)
tree39629a40e3968d2e86265f78a691c22e4b8e95c0
parent53e432db41f2a62009e264b7b85397df2957b5bd (diff)
Added TextHeight
-rw-r--r--bitmapfont.mod/bitmapfont.bmx13
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