-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monitor Display Switching Functions #9003
Comments
function window_get_display_count() {
var _data = window_get_visible_rects(0, 0, 1, 1);
return array_length(_data) / 8;
} You can get dimensions of screens in similar manner in fact (as window_get_visible_rects is meant to get info about which positions on screen current window overlaps, even if it's partially on more than 1 screen, but it also returns those displays dimensions, so by calling this function with any args we're getting info we want on positions |
This almost begs for a little MIT library to cover these in user-friendly functions, just in case, this FR never sees light of day... |
I was wondering about adding it to the Community Toolbox, but a single function call takes about 0.3-0.6ms on my beefy PC, so doing various calls referring to What I usually end up doing is creating a constructor which stores the data from Other than that, I do like the idea of built-in functions as described in the FR, so I upvoted it. ^^ |
I had someone request that I do this in duck game a while ago and I mostly ignored it because GM doesn't give you an easy way to do this. Hmmm... |
What brought me here was
Here is some useful debug code I wrote to sniff out the behavior of the relevant functions; maybe it helps someone:
|
Is your feature request related to a problem?
Currently the only way (without extensions) of querying for multiple displays is through window_get_visible_rects(). In addition, simple functions for simply switching which display your game window doesn't exist, which leads to a lot of hacky solutions.
Describe the solution you'd like
Ideally, I want a whole suite of functions related to messing with the window and its current display.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: