Author Topic: Basic question about window size  (Read 150 times)

Basic question about window size
« on: July 07, 2018, 11:51:32 AM »
Hi there!  I just learned about QB64 yesterday because I'm doing this goofy roguelike project:  https://twitter.com/zapjackson/status/1015367087508746240

I have an embarrassingly basic question -- I've been working in QuickBASIC in DOSBox at 2x scaling, and while the screen size of QB64 is really great for coding, I really need the finished product to run in a larger window.

Is there some trick I'm missing to scale the window up when it's in the default 80x24 text screen, or to make it gracefully user-resizable?  I'd love to release this thing when it's done, but it's too small to be comfortable to play on modern monitors.

Zack

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: Basic question about window size
« Reply #1 on: July 07, 2018, 12:59:19 PM »
Hi there and welcome to the forum!

Just add this to the beginning of your program:
Code: [Select]
$RESIZE:STRETCH
You can also replace stretch with SMOOTH for some antialiasing.

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: Basic question about window size
« Reply #2 on: July 07, 2018, 01:05:58 PM »
If you want an alternative resolution (any size really), you can:

Code: [Select]
myScreen& = _NEWIMAGE(width, height, mode)
SCREEN myScreen&

With mode being any legacy graphic mode (7, 13...) or even 256 (for 8bit color mode) or 32 for 32bit color mode.

We also have easy _RGB32 mixing available:

Code: [Select]
SCREEN _NEWIMAGE(600, 600, 32)
COLOR _RGB33(255, 0, 0)
PRINT "This is bright red"

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: Basic question about window size
« Reply #3 on: July 07, 2018, 01:10:40 PM »
_NEWIMAGE can also create any-sized screen 0, except you don't give width and height in pixels, but in characters.

Re: Basic question about window size
« Reply #4 on: July 07, 2018, 08:00:43 PM »
Thanks so much, this is great!