summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-09-15 01:02:51 +0000
committerIan C <ianc@noddybox.co.uk>2005-09-15 01:02:51 +0000
commitc0f2a2148bddc8f286bc7c7f8440385fafd74a80 (patch)
treec4d823fbcb95d67620bc61deb52896aa3f755f63
parent1e5cf011817cca02b53ed7858a00210e7ad58614 (diff)
Added methods to get maximum font width and height
-rw-r--r--bitmapfont.mod/bitmapfont.bmx16
1 files changed, 16 insertions, 0 deletions
diff --git a/bitmapfont.mod/bitmapfont.bmx b/bitmapfont.mod/bitmapfont.bmx
index bcb98c5..35feb10 100644
--- a/bitmapfont.mod/bitmapfont.bmx
+++ b/bitmapfont.mod/bitmapfont.bmx
@@ -21,6 +21,8 @@ Type TBitmapFont
Field height:Int[NOCHR]
Field width:Int[NOCHR]
Field is_fixed:Int
+ Field max_width:Int
+ Field max_height:Int
Function Load:TBitmapFont(path:String, image_flags:Int)
Local fnt:TBitmapFont
@@ -41,11 +43,17 @@ Type TBitmapFont
Return Null
EndIf
+ fnt.max_width=-1
+ fnt.max_height=-1
+
fnt.is_fixed=Readint(str)
For f=0 Until NOCHR
fnt.width[f]=Readint(str)
fnt.height[f]=Readint(str)
+
+ fnt.max_width=Max(fnt.max_width,fnt.width[f])
+ fnt.max_height=Max(fnt.max_height,fnt.height[f])
fnt.img[f]=CreateImage(fnt.width[f],fnt.height[f],1,image_flags)
@@ -127,5 +135,13 @@ Type TBitmapFont
Return h
End Method
+
+ Method MaxWidth:Int()
+ Return max_width
+ End Method
+
+ Method MaxHeight:Int()
+ Return max_height
+ End Method
End Type