Difference between revisions of "DISPLAY (function)"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>SMcNeill
m (-)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:_DISPLAY (function)}}
 
{{DISPLAYTITLE:_DISPLAY (function)}}
The '''_DISPLAY''' function returns the handle of the current image that is displayed on the screen.
+
The [[_DISPLAY]] function returns the handle of the current image that is displayed on the screen.
  
  
 
{{PageSyntax}}
 
{{PageSyntax}}
:''currentimage&'' = '''_DISPLAY'''
+
:{{Parameter|currentImage&}} = [[_DISPLAY]]
  
  
''Usage:''
+
{{PageDescription}}
* Returns the current image handle value that is being displayed. Will return 0 if in the default [[SCREEN|screen]] image.
+
* Returns the current image handle value that is being displayed. Returns 0 if in the default [[SCREEN|screen]] image.
* Not to be confused with the [[_DISPLAY]] statement that displays the screen when not using {{KW|_AUTODISPLAY}}.
+
* Not to be confused with the [[_DISPLAY]] statement that displays the screen when not using [[_AUTODISPLAY]].
  
  
 +
{{PageExamples}}
 
''Example:'' Creating a mouse cursor using a page number that '''you create''' in memory without setting up page flipping.
 
''Example:'' Creating a mouse cursor using a page number that '''you create''' in memory without setting up page flipping.
 
{{CodeStart}}
 
{{CodeStart}}
Line 36: Line 37:
 
{{Cl|END SUB}} '' ''
 
{{Cl|END SUB}} '' ''
 
{{CodeEnd}}
 
{{CodeEnd}}
''Note:'' Works with the '''_DISPLAY function''' return as the other page. If mouse reads are not crucial, put the [[_MOUSEINPUT]] loop inside of the UpdateCursor Sub.
+
''Note:'' Works with the '''_DISPLAY function''' return as the other page. If mouse reads are not crucial, put the [[_MOUSEINPUT]] loop inside of the UpdateCursor SUB.
  
  
 
{{PageSeeAlso}}
 
{{PageSeeAlso}}
* [[SCREEN]] {{text|(note the QB64 use of SCREEN to set which image to display)}}
+
* [[SCREEN]]
 
* [[PCOPY]]
 
* [[PCOPY]]
 
* [[_DISPLAY]] {{text|(statement)}}
 
* [[_DISPLAY]] {{text|(statement)}}
 
* [[_AUTODISPLAY]] {{text|(default mode)}}
 
* [[_AUTODISPLAY]] {{text|(default mode)}}
 +
* [[_DISPLAYORDER]] {{text|(statement)}}
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Latest revision as of 20:46, 24 September 2017

The _DISPLAY function returns the handle of the current image that is displayed on the screen.


Syntax

currentImage& = _DISPLAY


Description

  • Returns the current image handle value that is being displayed. Returns 0 if in the default screen image.
  • Not to be confused with the _DISPLAY statement that displays the screen when not using _AUTODISPLAY.


Examples

Example: Creating a mouse cursor using a page number that you create in memory without setting up page flipping.

SCREEN _NEWIMAGE(640, 480, 32) 'any graphics mode should work without setting up pages _MOUSEHIDE SetupCursor PRINT "Hello World!" DO: _LIMIT 30 DO WHILE _MOUSEINPUT: LOOP 'main loop must contain _MOUSEINPUT ' other program code LOOP SUB SetupCursor ON TIMER(0.02) UpdateCursor TIMER ON END SUB SUB UpdateCursor PCOPY _DISPLAY, 100 'any page number as desination with the _DISPLAY function as source PSET (_MOUSEX, _MOUSEY), _RGB(0, 255, 0) DRAW "ND10F10L3F5L4H5L3" _DISPLAY 'statement shows image PCOPY 100, _DISPLAY 'with the function return as destination page END SUB

Note: Works with the _DISPLAY function return as the other page. If mouse reads are not crucial, put the _MOUSEINPUT loop inside of the UpdateCursor SUB.


See also



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