1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 15:00:38 +00:00
QB64-PE/internal/help/_SCREENMOVE.txt

71 lines
3 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_SCREENMOVE}}
2017-10-10 14:55:21 +00:00
The [[_SCREENMOVE]] statement positions the program window on the desktop using designated coordinates.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: [[_SCREENMOVE]] {{{Parameter|column&}}, {{Parameter|row&}}|_MIDDLE}
{{Parameters}}
2017-10-10 14:55:21 +00:00
* Positions the program window on the desktop using the {{Parameter|column&}} and {{Parameter|row&}} pixel coordinates for the upper left corner.
* '''_MIDDLE''' can be used instead to automatically center the program window on the desktop, in any screen resolution.
2017-10-10 14:55:21 +00:00
{{PageDescription}}
* The program's [[SCREEN]] dimensions may influence the desktop position that can be used to keep the entire window on the screen.
2017-10-10 14:55:21 +00:00
* Use [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]] to find the current desktop resolution to place the program's window.
* On dual monitors a negative {{Parameter|column&}} position or a value greater than the main screen width can be used to position a window in another monitor.
* '''A small delay may be necessary when a program first starts up to properly orient the screen on the desktop properly.''' See [[_SCREENEXISTS]].
2021-01-04 18:45:32 +00:00
* '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux versions]]'''
2017-10-10 14:55:21 +00:00
{{PageExamples}}
''Example 1:'' Calculating the border and header offsets by comparing a coordinate move with _MIDDLE by using trial and error.
{{CodeStart}}
userwidth& = {{Cl|_DESKTOPWIDTH}}: userheight& = {{Cl|_DESKTOPHEIGHT}} 'get current screen resolution
{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 256)
2017-10-10 14:55:21 +00:00
scrnwidth& = {{Cl|_WIDTH}}: scrnheight& = {{Cl|_HEIGHT}} 'get the dimensions of the program screen
2017-10-10 14:55:21 +00:00
{{Cl|_SCREENMOVE}} (userwidth& \ 2 - scrnwidth& \ 2) - 3, (userheight& \ 2 - scrnheight& \ 2) - 29
{{Cl|_DELAY}} 4
{{Cl|_SCREENMOVE}} _MIDDLE 'check centering
{{Cl|END}} '' ''
{{CodeEnd}}
: When positioning the window, offset the position by -3 columns and - 29 rows to calculate the top left corner coordinate.
''Example 2:'' Moving a program window to a second monitor positioned to the right of the main desktop.
2017-10-10 14:55:21 +00:00
{{CodeStart}}
wide& = {{Cl|_DESKTOPWIDTH}}
high& = {{Cl|_DESKTOPHEIGHT}}
2019-04-15 01:15:33 +00:00
{{Cl|PRINT}} wide&; "X"; high&
{{Cl|_DELAY}} 4
{{Cl|_SCREENMOVE}} wide& + 200, 200 'positive value for right monitor 2
img2& = {{Cl|_SCREENIMAGE}}
wide2& = {{Cl|_WIDTH (function)|_WIDTH}}(img2&)
high2& = {{Cl|_HEIGHT}}(img2&)
2019-04-15 01:15:33 +00:00
{{Cl|PRINT}} wide2&; "X"; high2&
{{Cl|_DELAY}} 4
{{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} 'moves program back to main monitor 1 '' ''
{{CodeEnd}}
2017-10-10 14:55:21 +00:00
: ''Notes:'' Change the [[_SCREENMOVE]] column to negative for a left monitor.
2019-04-15 01:15:33 +00:00
<center>'''[[_FULLSCREEN]] works in the primary monitor and may push all running programs to a monitor on the right.'''</center>
2017-10-10 14:55:21 +00:00
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[_SCREENX]], [[_SCREENY]]
2017-10-10 14:55:21 +00:00
* [[_SCREENIMAGE]], [[_DESKTOPWIDTH]], [[_DESKTOPHEIGHT]]
2016-03-18 11:36:04 +00:00
* [[_SCREENPRINT]]
2017-10-10 14:55:21 +00:00
* [[_SCREENEXISTS]]
* [[_NEWIMAGE]], [[SCREEN (statement)]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}
<