Author Topic: fontheight and a question about user resizable windows  (Read 645 times)

Ed Davis

  • Newcomer
  • *
  • Posts: 16
    • View Profile
fontheight and a question about user resizable windows
« on: 27. March 2014, 14:10:03 »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: fontheight and a question about user resizable windows
« Reply #1 on: 27. March 2014, 18:12:50 »
1. First you have to load a font (bitmap font) like this:
Code: [Select]
myfont = loadbmpfont (filename, lines, rows, fontface)The variable myfont holds the fontnumber. So you can access it by using e.g.
Code: [Select]
fheight=fontheight (myfont)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: [Select]
resizewindow (x,y)
Best regards,
Cybermonkey