Get Element Earth ▶
Support This Channel ▶

Follow me on Facebook ▶
Follow me on Instagram ▶
Follow me on Twitter ▶
Follow me on Google+ ▶

Here it is. Time to use the knowledge learnt in the Screen Capture tutorial to fool the player into believing the game is still running behind the pause menu when in actual fact it’s all deactivated and invisible.

▼ Useful Links and Resources ▼
GM Studio Project ▶
GM 8 Project ▶

▼ More ▼
General Game Maker Playlist ▶
Game Maker Networking ▶

Happy Coding 😀

Nguồn: https://shaarique.com/

Xem thêm bài viết khác: https://shaarique.com/game/

45 Comments

GravityShift Games

June 28, 2020

Be sure to subscribe for more great videos https://www.youtube.com/channel/UCAumdO1yv-di4fI6IZQIy3Q?sub_confirmation=1

Reply

A Osorto

June 28, 2020

if you have a problem with creating the pause menu screen in which it appears in the bottom right corner, just change the draw_sprite coordinates to the center of the room

if your room's size is 640×850 for an example, you just change the x and y draw coordinates to its half,
320, 425.

Reply

LifeAfterBreakfast

June 28, 2020

great video thanks!

Reply

Andrew Moore

June 28, 2020

Great tutorial, however when used in conjunction with your resolution tutorial the pause menu does not rescale. I've tried updating the GUI scale as done in the script however this doesn't seem to work because the pause menu is sprite based rather than object oriented. Have you any suggestion on how to implement the pause menu with your resolution tutorial?

Reply

R. Marshellow

June 28, 2020

sir ? where can i find .dat file? how to create it?

Reply

R. Marshellow

June 28, 2020

where can i finf .dat file?

Reply

Clayton Games

June 28, 2020

There is an issue the menu won't work with drawing sprites you have to draw objects cus sprites are just pictures how do you draw an object?

Reply

Azurum Sounds

June 28, 2020

You might want to include a sprite_delete(background) on the Destroy event as well, otherwise it will keep eating up memory every time you pause the game. At least that's what it was doing for me. Great tutorial though.

Reply

Igor Costa

June 28, 2020

This tutorial works on the Studio version of Game Maker?

Reply

Shinu Real

June 28, 2020

It's me again.
The pause system works just fine on GM8, but once in GM Studio, it has a bug, even in the GMS file you provided: The menu doesn't appear in the center of the room when you switch to full screen.
I've tried to fix this by stating "if" window_get_fullscreen function, but did't work.

Reply

CmiPlay

June 28, 2020

How do I make it fit my screen if it's 640x 480?

Reply

Shinu Real

June 28, 2020

Thanks a lot!

Reply

pupypup

June 28, 2020

what if you have objects you deactivated and you want them to stay deactivated even after pausing and unpausing?

Reply

Wolfie The Wolf

June 28, 2020

how do i do this for 3d?
+SlasherXGAMES ™

Reply

Ethan Cooper

June 28, 2020

I am having trouble with this pause menu. So my game is a platformer and I have a view that is very small but the pause menu and the room is very big, how do I fix this?

Reply

Trey Fore

June 28, 2020

I love this idea but am having trouble making it work. I have used all the logic that is used in this video and everything is working great except when I go to move around in the menu only my last option works with drawing its sub image. anyone know what i could be doing wrong? Thank you in advance!

Reply

Nathan Laing

June 28, 2020

In GameMaker, is using the "instance_activate"/"instance_deactivate" series of functions the only way to effect a pause?
Isn't there some kind of global "wrapper" you could put around the entire code that's running in GameMaker?

Reply

Icezaza1

June 28, 2020

ERROR in
action number 1
of Draw Event
for object obj_pause_menu_controller:

Trying to draw non-existing sprite.

Reply

Icezaza1

June 28, 2020

FATAL ERROR in
action number 1
of Create Event
for object obj_pause_menu_controller:

COMPILATION ERROR in code action
Error in code at line 13:
background = sprite_add("workingscreenie.png", 0, false, true, 640, 360);
^

Reply

How2BEpic

June 28, 2020

Been spending all day trying to get a basic pause going.
I had an issue with game maker following these exact instructions for some reason, but I fixed t and it works brilliantly.
Subbed.

Reply

GoddessKalypso

June 28, 2020

I had to change obj_pause_menu_controller > create > "background = sprite_add("screenie.png"), 0, false, true, 640, 360);" to "background = sprite_add_alpha("screenie.png"), 0, false, true, 640, 360);" in order for it to work. Once I pass through the main menu I previously created and into my "TestingRoom", when I his the "Escape" key, I get the error message,

"ERROR in
action number 1
of Draw Event
for obj_pause_menu_controller:

Trying to draw non-existing sprite."

How do you suggest I fix this?

Reply

Jamie Engel

June 28, 2020

Thanks now  i bayme cam success my FPS game but it might not work with 3d games???

Reply

Richard Hambrook

June 28, 2020

NOBODY USES FUCKING KEYS FOR A MENU EVER

Reply

Matix Gaming

June 28, 2020

So i wanted to do this but instead of the sprites i wanna create objects like a textbox and a input field but when i create them i dont see them at all… when i remove the background i do see them but i wanna have the background haha , could you help me?

Reply

George Junior

June 28, 2020

How to convert it to Touch Screen Method?
since it used UP and Down arrow key.

Reply

NerdBurglars Gaming

June 28, 2020

is it more efficient to add the object to every room rather than creating it once and using escape to toggle a global variable?

Reply

CanyonsGaming

June 28, 2020

How do I add object_room_controller? @SlasherXGAMES ™

Reply

Lukáš Zdražil

June 28, 2020

i have problems with dra GUI event

Reply

Connor Magson

June 28, 2020

How would I get this to work with the mouse? I've been trying to use 'point_in_rectangle' but I can't manage to get it to work.

Reply

oscar

June 28, 2020

When I go to a room the pause menu pops up automaticly. Does somebody knows how to fix this?

Reply

GameThemer

June 28, 2020

Thanks for this tutorial 😀
Finally I have n working Pause Menu :DD

Reply

sirtrevis42

June 28, 2020

If I am using the mouse to select buttons, how would I go about tweaking this so it detects my mouse and knows where the interest is? I would still like to use the interest = "continue" and most of what you have if i can, but just need it to check for mouse instead of enter and so on.

Reply

mvtube007

June 28, 2020

If I have different resolution rooms?

Reply

Ethan N.

June 28, 2020

Going into full screen then pausing causes the screenshot to move to the right side of the screen. It doesn't seem to work too well in full screen, any idea how to fix this?

Reply

paul

June 28, 2020

how comes when i do this the pause screen dont align with my game, it just goes to the side etc

Reply

JacobTurnero

June 28, 2020

Liked for the intro :O

Reply

Andrew

June 28, 2020

using screen_save is an extremely elegant solution. this was helpful, thank you.

Reply

HotShot888

June 28, 2020

This tutorial was very helpful, thanks a lot!

However, there seems to be some lag when pausing. Even in the example you provided, when I press the pause button, the objects get frozen, but there's almost a second of delay before UI appears. Any idea what to do about that?

Reply

Gabriel Villalobos

June 28, 2020

If I want to do the buttons on clicks…. How do I do that? xD

Reply

Felix Halim

June 28, 2020

how to resize the  box? it is really big in my game … thx

Reply

WhiteSprite

June 28, 2020

When I try to launch the game, all it gives me is a windows that says "compile errors", and it doesn't show any errors. Just a little blue line. HELP!

Reply

n-young

June 28, 2020

I had a problem where the esc buton would deactivate everything, put the background on fine, put none of my buttons are placed. No errors pop up either.

Reply

Pedro Adorno

June 28, 2020

When i press escape, nothing happens… no compile errors what so ever 🙁
I've sent you a message with my project link 🙂

Reply

Jayden Muzzin

June 28, 2020

Hey, I was wondering whether you might be able to assist me with my pause menu. I have gone through and watched many parts of this video several times and used some of your code to develop mine, 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 and I want a transparent background across the entire screen, with the pause menu options in the middle of the screen like yours.

My current Draw event looks likes this:

draw_sprite(background, 0, 640, 360);
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.

Thanks so much in advance and awesome video!

Reply

0neo8

June 28, 2020

i love the channel , this is the first that did not work for me. i think its because you had a lot of stuff done already. i have been trying to get this working on my game for college but even as i typed i knew it wouldn't work because some of the code stayed black and not coloured . I still learned a lot from doing it. Gamemaker code is not so bad after all 

Reply

Leave a Reply