1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 15:35:53 +00:00
QB64-PE/internal/help/_DISPLAY_(function).txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

47 lines
1.8 KiB
Plaintext

The {{KW|_DISPLAY (function)|_DISPLAY}} function returns the handle of the current image that is displayed on the screen.
{{PageSyntax}}
:''currentimage&amp;'' = '''_DISPLAY'''
''Usage:''
* Returns the current image handle value that is being displayed. Will return 0 if in the default image.
* Not to be confused with the {{KW|_DISPLAY}} statement that displays the screen when not using {{KW|_AUTODISPLAY}}.
''Example:'' Creating a mouse cursor using a page number that '''you create''' in memory without setting up page flipping.
{{CodeStart}}
{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) 'any graphics mode should work without setting up pages
{{Cl|_MOUSEHIDE}}
SetupCursor
{{Cl|PRINT}} &quot;Hello World!&quot;
{{Cl|DO}}: {{Cl|_LIMIT}} 30
{{Cl|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}}: {{Cl|LOOP}} 'main loop must contain _MOUSEINPUT
' other program code
{{Cl|LOOP}}
{{Cl|SUB}} SetupCursor
{{Cl|ON TIMER(n)|ON TIMER}}(0.02) UpdateCursor
{{Cl|TIMER}} ON
{{Cl|END SUB}}
{{Cl|SUB}} UpdateCursor
{{Cl|PCOPY}} {{Cl|_DISPLAY (function)|_DISPLAY}}, 100 'any page number as desination with the _DISPLAY function as source
{{Cl|PSET}} ({{Cl|_MOUSEX}}, {{Cl|_MOUSEY}}), {{Cl|_RGB}}(0, 255, 0)
{{Cl|DRAW}} &quot;ND10F10L3F5L4H5L3&quot;
{{Cl|_DISPLAY}} 'statement shows image
{{Cl|PCOPY}} 100, {{Cl|_DISPLAY (function)|_DISPLAY}} 'with the function return as destination page
{{Cl|END SUB}} '' ''
{{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.
{{PageSeeAlso}}
* [[SCREEN]] {{text|(note the QB64 use of SCREEN to set which image to display)}}
* [[PCOPY]]
* [[_DISPLAY]] {{text|(statement)}}
* [[_AUTODISPLAY]] {{text|(default mode)}}
{{PageNavigation}}