SOLVED GUI not drawing on Windows

I'm developing a game on Mac and I sent my project files to a friend who has Game Maker on PC so that he could create a PC build for me. The build worked for him, except that for some reason for him nothing is being drawn to the GUI. It's as though no "Draw GUI" events are running. The regular "Draw" events all work and the GUI elements are functional (i.e. if he clicks where a button is supposed to be it still functions) but nothing is visible. Because the problem only manifests on his computer it's impossible for me to do much investigation myself so I hope someone might be able to help. Does anyone know why this might be happening?
 

Tyg

Member
Do you have a draw_self(); in the Draw GUI event?
The draw event doesn't need it...but the draw gui event does. :)
 
Most of the GUI objects don't use `draw_self()` specifically since they're drawing text or shapes or other things ... Is `draw_self()` required for some reason?
 
I'm not sure exactly what code I should share since this issue is affecting everything that's drawing to the GUI, but here's an example from the Draw GUI event of one object that draws a rectangle:
GML:
draw_set_alpha(image_alpha);
draw_set_colour(image_blend);
if rounded draw_roundrect(x, y, x + width, y + height, false);
else draw_rectangle(x, y, x + width, y + height, false);
draw_set_alpha(1);
Instead of the code being wrong, I suspect it might be a setting in the editor somewhere having to do with how the GUI is rendered, in which case my friend might have a different setting than me? Because yeah he's running the exact same project, all the files are the same so I don't know why it would behave differently.
and at this point I'm just trying to show this project to friends as a work-in-progress so I don't think the licensing issue applies
 
Okay, I've managed to fix the issue. Objects that draw to the GUI were being put in a layer with a depth of -200000, with the main instance layer having a depth of 0. I made the GUI layer have a depth of 0 and increased the depth of all the other layers proportionally and now the GUI draws properly.

Perhaps on Windows builds the GUI is always drawn at a depth of 0 by default, so it might get covered by other objects with negative depths, whereas on a Mac the GUI is always drawn on top? I don't fully understand what was going on but this fixed it for me.

Anyway it's a little scary that the same project behaves differently based on what system it's compiled on since the point of a cross-platform IDE is that it should wind up behaving the same.
 
Top