FULLSCREEN

From QB64 Wiki

Jump to: navigation, search

The _FULLSCREEN statement attempts to make the program window fullscreen.


Syntax:

_FULLSCREEN [{ _OFF | _STRETCH | _SQUAREPIXELS}]


Description:

  • The statement can be used in ANY SCREEN mode. Set the screen mode (and text WIDTH when necessary) first!
  • _FULLSCREEN can use the following methods:
    • _STRETCH default first choice attempts to mimic QBasic's full screens if possible. _FULLSCREEN function returns 1.
    • _SQUAREPIXELS default second choice enlarges the pixels into squares. _FULLSCREEN function returns 2.
    • _OFF turns fullscreen off after full screen has been enabled. _FULLSCREEN function returns 0.
  • If no option/method is specified after _FULLSCREEN, QB64 chooses _STRETCH or _SQUAREPIXELS (note: this prioritizes _STRETCH to mimic QBASIC when possible)
  • Always check the fullscreen mode with the _FULLSCREEN function in your programs!
  • It is advisable to get input from the user to confirm that fullscreen was completed or there were possible monitor incompatibilities.
  • If fullscreen is not confirmed with a _FULLSCREEN function return greater than 0, then disable with _FULLSCREEN _OFF!
  • NOTE: _FULLSCREEN can also be affected by custom _FONT size settings!


Example: How fonts and _FULLSCREEN change the program window size.

SCREEN 0 DO PRINT LINE INPUT "Enter MODE 1) ENLARGE WINDOW 2) FULL _SQUAREPIXELS 3) FULL _STRETCH: ", WMODE$ PRINT IF WMODE$ = "1" THEN INPUT "SIZE 1 TO 9: ", ENLARGE% SELECT CASE ENLARGE% CASE 1, 2, 3, 4, 5: STYLE$ = "MONOSPACE, BOLD" CASE 6, 7, 8, 9: STYLE$ = "MONOSPACE" CASE ELSE: STYLE$ = "MONOSPACE" END SELECT SELECT CASE WMODE$ CASE "1" full = _FULLSCREEN IF full > 0 THEN _FULLSCREEN _OFF f& = _LOADFONT("c:\windows\fonts\lucon.ttf", 13 + ENLARGE%, STYLE$) _FONT f& CASE "2" _FULLSCREEN _SQUAREPIXELS full = _FULLSCREEN IF full = 0 THEN GOSUB FCHECK CASE "3" _FULLSCREEN _STRETCH full = _FULLSCREEN IF full = 0 THEN GOSUB FCHECK END SELECT mode = _FULLSCREEN PRINT PRINT "_FULLSCREEN mode ="; mode, PRINT "PRESS ESC TO END OR ENTER TO CONTINUE..." DO: SLEEP: B$ = INKEY$: LOOP UNTIL B$ = CHR$(13) OR B$ = CHR$(27) GOSUB ClearFont LOOP UNTIL B$ = CHR$(27) ClearFont END FCHECK: Z3 = timer DO IF TIMER < Z3 THEN Z3 = Z3 - TIMER IF TIMER - Z3 > 4 THEN EXIT DO LOOP full = _FULLSCREEN IF full = 0 THEN _FULLSCREEN _OFF: SOUND 100, .75 RETURN ClearFont: IF f& > 0 THEN _FONT 16 'select inbuilt 8x16 default font _FREEFONT f& END IF RETURN



See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Views
Personal tools
Toolbox