Difference between revisions of "DISPLAY"

From QB64 Wiki
Jump to navigation Jump to search
imported>Cyperium
imported>Cyperium
m
Line 15: Line 15:
{{CodeStart}}
{{CodeStart}}


SCREEN 13, 0, 1, 0
{{Cl|SCREEN (statement)|SCREEN}} 13, 0, 1, 0


dx = 1: dy = 1
dx = 1: dy = 1
DO
{{Cl|DO}}
     PCOPY 1,0
     {{Cl|PCOPY}} 1,0
     CLS
     {{Cl|CLS}}
     _LIMIT 60 ' set to 60 frames per second
     {{Cl|_LIMIT}} 60 ' set to 60 frames per second
     x = x + dx: y = y + dy
     x = x + dx: y = y + dy
     IF x < 0 OR x > 320 THEN dx = -dx
     {{Cl|IF...THEN|IF}} x < 0 {{Cl|OR}} x > 320 {{Cl|THEN}} dx = -dx
     IF y < 0 OR y > 200 THEN dy = -dy
     {{Cl|IF...THEN|IF}} y < 0 {{Cl|OR}} y > 200 {{Cl|THEN}} dy = -dy
     CIRCLE (x, y), 10, 15
     {{Cl|CIRCLE}} (x, y), 10, 15
     _DISPLAY
     {{Cl|_DISPLAY}}
LOOP UNTIL INKEY$ = CHR$(27)
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = CHR$(27)


{{CodeEnd}}
{{CodeEnd}}

Revision as of 01:28, 19 January 2010

The _DISPLAY statement turns off the automatic display of the screen graphics (which is at around 30 fps) while displaying the screen graphics.


Syntax

_DISPLAY


Description

  • _DISPLAY turns off the default _AUTODISPLAY when used.
  • Call _DISPLAY each time the screen graphics are to be displayed.
  • Re-enable the automatic display by calling _AUTODISPLAY.


Examples

SCREEN 13, 0, 1, 0 dx = 1: dy = 1 DO PCOPY 1,0 CLS _LIMIT 60 ' set to 60 frames per second x = x + dx: y = y + dy IF x < 0 OR x > 320 THEN dx = -dx IF y < 0 OR y > 200 THEN dy = -dy CIRCLE (x, y), 10, 15 _DISPLAY LOOP UNTIL INKEY$ = CHR$(27)

Displays a circle going around the screen at 60 frames per second, displaying each frame to the screen.


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page