GameMaker: Studio

GameMaker: Studio

View Stats:
$bLoCkChAiN$ Dec 13, 2014 @ 12:11am
Trouble Creating a Pause Menu
I am having trouble with creating a pause menu in my game. I have watched many tutorials and done a lot of research to try and resolve this issue, but I still cannot get it to work. Every event apart of my pause object, which creates the pause menu and everything associated with pausing and unpausing the game, works, except the Draw event. When I pause my game, it just generates the default grey background. I have tried numerous options to try and get it to work, but it always yields the same result - this grey background. I'm using views so I'm assuming the menu is just being drawn somewhere else in the room and the dimensions are incorrect somehow. Ideally, I want a transparent background across the entire screen, with the pause menu options in the middle of the screen.

My current Draw event looks likes this:

draw_set_alpha(0.5);
draw_sprite(background, 0, view_xview[0], view_yview[0]); /* background is a screenshot of the game immediately prior to pausing it */
draw_set_halign(fa_center);
draw_set_font(fnt_menu);
draw_set_color(c_white);
draw_set_alpha(1);
draw_text(view_xview[0]/2, view_yview[0]/4, "Game Paused");
draw_set_color(c_black);

var m;
for (m = 0; m < array_length_1d(pausemenu); m++)
{
draw_text(view_xview[0]/2, view_yview[0]/2 + (m * pmspace), string(pausemenu[m]));
}

The second section of the event with the for loop is supposed to draw the options on the pause menu which are stored in an array and listed down with space between when drawn.

Any help regarding my problem would be greatly appreciated.
Date Posted: Dec 13, 2014 @ 12:11am
Posts: 0