Pixel Perfect and "Pixel Snapped" GUI

cauehsf

Member
Hi guys, I need to make my GUI layer "pixel-perfect", and found no clue around here..

The blue cube is being drawn in the "Draw GUI" event
The white cube is being drawn in the "Draw" event

GML:
//I want the blue cube to behavior like the white one while rotating.
//But found nothing like this for GUI layer:
surface_resize(application_surface, 240, 240);

//Just a quick edit, I already did this, and had no progress:
display_set_gui_size(240, 240);
Anyway of doing that? Thank you for reading!

GUIPixelPerfect.gif
 

FoxyOfJungle

Kazan Games
Where are you calling these functions from?
If you used display_set_gui_size(), it would be mandatory to change it. Are you reversing the size somewhere in the code after using this function?
 

TrunX

Member
Oh is it still a thing? I think I reported a bug in GameMaker Studio 1 times that using the draw_[shape]() functions on a GUI layer ignores the GUI resolution and is always drawn sharp in the monitor resolution.

My workaround was to use the post-draw event instead and never checked if it got solved. But maybe its smth. different in this case.
 

cauehsf

Member
Where are you calling these functions from?
If you used display_set_gui_size(), it would be mandatory to change it. Are you reversing the size somewhere in the code after using this function?
Nope, no changes at all, I'm calling this function on the "Create Event" of my "objCamera", and never calling it again.
 

cauehsf

Member
Oh is it still a thing? I think I reported a bug in GameMaker Studio 1 times that using the draw_[shape]() functions on a GUI layer ignores the GUI resolution and is always drawn sharp in the monitor resolution.

My workaround was to use the post-draw event instead and never checked if it got solved. But maybe its smth. different in this case.
Seems like a great solution, but one thing bother me, do you need to sum every single position with your camera's x and y? I don't see this as a good thing, though it's a great workaround..
 
Top