Asset - Extension Border Toggler (for Windows, macOS, and Ubuntu)

  • Thread starter Sam (Deleted User)
  • Start date
S

Sam (Deleted User)

Guest

Toggle the border of your game window on and off with GameMaker on Windows, macOS, and Ubuntu.

Very special thanks to babyjeans <twitter.com/babyj3ans> for helping me figure this out on Windows.

Recall the good old GM 8.1 days where you could window_set_showborder(!window_get_showborder())?

Note: if you modify the library's source, the copyright notice in the library source code must stay intact.

 
Last edited by a moderator:

derboo

Member
Don't know if it's just me, but I've got an issue in Windows 10.

When I switch the border off with this extension, the Window gets stretched to include the area where the border was previously, different from the Mac demo video where the border gets just cut off cleanly without changing the window size.

Even when I change the window size with window_set_size, the actual size is always a bit larger than I set it. Similarly, when I start the application with a borderless window and use the extension to add the border, the window content gets squished.

Is there any solution for this?
 
S

Sam (Deleted User)

Guest
Don't know if it's just me, but I've got an issue in Windows 10.

When I switch the border off with this extension, the Window gets stretched to include the area where the border was previously, different from the Mac demo video where the border gets just cut off cleanly without changing the window size.

Even when I change the window size with window_set_size, the actual size is always a bit larger than I set it. Similarly, when I start the application with a borderless window and use the extension to add the border, the window content gets squished.

Is there any solution for this?
I'm on Windows 11 right now, so here's the results of my testing on there, which I'll address first, then I'll hop over to my Windows 10 machine to take more screenshots.

Here's without the border with a 640x480 window (taken with the Window Snipping Screenshot tool Windows has).

Screenshot 2021-11-22 170102.png

Below is what you see with the border restored:

Screenshot 2021-11-22 170129.png

This last one, is taken before calling any borderless toggle code, having it completely commented out:

Screenshot 2021-11-22 171004.png

As you can see the last two are identical, though the client area is slightly bigger than 640x480 when the border is there, that i believe is a new behavior Microsoft added to compensate for the curved window edges, because GMS does this for a room set to 640x480 regardless of whether my extension is involved or not.

This extension was originally written on Windows 10 but I'm changing machines now just in case something changed.

Edit:

Just tried it on Windows 10 and the client area is perfectly 640x480 both with and without the border toggled via my extension:

Capture1.PNG

Capture2.PNG

Note I'm aware resizing the window in code is broken after toggling the border at least once, and there is not much I can do about that since that's more-so an issue with how GameMaker handles window sizing internally relative to the current window style.
 
Last edited by a moderator:

derboo

Member
Hmm, I see. I was trying to use this for a borderless fullscreen function, so I guess that's not gonna work for me with Game Maker.

Wonder if the resizing behavior could be filed as a bug report to Yoyo Games, but given the border change is not an officially supported function to begin with, I guess chances are low...

Thanks for testing and elaborating!
 
Top