Retrogamecoding(.org) > EGSL

fontheight and a question about user resizable windows

(1/1)

Ed Davis:
1) I want to write some text to a Window.  I'd like to know how much I can fit, so I was thinking I would use fontheight to determine the height of the font.  But fontheight requires a fontnumber.  After opening a window, how do I determine the fontnumber?

2) Is there a way to create a user-resizable window in EGSL?

Thanks!

Cybermonkey:
1. First you have to load a font (bitmap font) like this:

--- Code: ---myfont = loadbmpfont (filename, lines, rows, fontface)
--- End code ---
The variable myfont holds the fontnumber. So you can access it by using e.g.

--- Code: ---fheight=fontheight (myfont)
--- End code ---
If you are using a monofont, use monoheight instead.

2. Nope that's not possible. Of course you can make a menu or something where one can choose the size, then use

--- Code: ---resizewindow (x,y)
--- End code ---

Navigation

[0] Message Index

Go to full version