Hello everyone, in this GameMaker Studio 2 Tutorial video we learn how to make a simple pause menu that works with viewports because most likely you’ll be using some sort of camera system in your game, and this method works really well to add a basic pause screen functionality to your game. We make a new font, edit (or create) an object to add a new variable called ‘pause’ to the create event, and add a few conditional statements to the step event and draw GUI event. We review some functions and go over some new functions that will be used to set color, opacity, draw rectangles, and text to the screen. The meat of this tutorial falls on a couple of really cool functions that let all objects be temporarily suspended until we toggle the new Boolean switch we created. (pause) I thought this would work well in most simple prototype games and even in some fully completed demos. Hopefully you found this tutorial helpful.

In this GameMaker Studio 2 Tutorial series we’re going to look at all aspects of being a solo indie dev. We’re going to learn how to program using GameMaker Language(GML), how to make your own sprites, animations, sound effects, background music, tilesets, and basically everything related to making a game as a one person game studio. We’re going to do all of this, one small step at a time, by learning one thing at a time. Eventually after making several simple (and probably crappy) games, we’re going to try to make a game we can sell to make money. This should be a long running series and I’ll try to make these tutorials modular, so if you miss one of these tutorials you won’t be completely lost on the next few tutorials. I’m designing these tutorials to tackle a few simple things in each video (or maybe one big thing) so that you can hop around the playlist to freshen up on something you forgot how (or never learned) how to do if you get stuck. I hope you enjoy the GMS2 Tutorial series.

If you’ve enjoyed this video please consider giving it a Like, Favorite and share. You could always Subscribe to the channel if you haven’t already and as always, thanks for watching and we’ll see you in the next video! 🙂

DG Discord Server:

Website:

Twitch:

Twitter:

Patreon:

——————————-
Special thanks to all my Patrons:
Damian Floyd, Fun4theBrain, David Philips, Studio Blue, Battle Pisces Gaming, Michael Flynn, John Gibson, ChrAndGow, Scott Zarwell, Edwardo Santizo, NeoSoulGamer, Jai R Fisher, Rusty_Gears, Meteodros, R.A.M, Valryia, DarkKrow13, StalkerRoguen, Ervin Mcclure, Chris Van Essen, Mithrandir, Michael Noles and those of you who have supported me in the past.

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

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

20 Comments

A RANDOM OTAKU

June 29, 2020

Thanks a bunch dude, I've been having some trouble finding a tutorial on this method.

Reply

William Oxenberg

June 29, 2020

8:07

Reply

AR is Nobody

June 29, 2020

10/10 Background. Anyone who says otherwise is wrong

Reply

Lachrymogenic

June 29, 2020

Nice background 😉

Reply

Epic Gamer

June 29, 2020

AAAGGHHH THE BACKGROUNDDD

Reply

Spencer T

June 29, 2020

Background is awesome

Reply

Shanth Narayanan

June 29, 2020

Hey. Nice video. I'm working on a Mining-Simulation game. Is there a way to make the game run automatically at startup? Your guidance would be appreciated. Btw, I'm using GM 8.

Reply

Filipe Miranda

June 29, 2020

How to we put objects in the GUI of the Pause Menu?

Reply

Laszlo Eszik

June 29, 2020

Cool tutorial! My question is if this specific code still works the same now as it was working when the tutorial was made. As newer versions of gamemaker studio 2 came out they actually changed functionality? Here's what I found when I tried out your code:
– instance_deactivate_all(true); deactivates all other instances AND makes everything disappear
– draw_set_alpha(0.4); in DrawGUI sets every alpha to 0.4 (all sprites too!), so I had to put a draw_set_alpha(1) where instance_activate_all(); is
The latter I found out as I wasn't writing "Pause" on the screen 🙂 . Is it possible Yoyo messed up draw_set_alpha? Or is it me who didn't use some function properly, or I don't know. 😀 I am learning game maker studio 2, not the first time I hit rock bottom with coding stuff.

Reply

Jakub Moravec

June 29, 2020

hey man, i need to create inventory menu where player can interact with items when the game is paused. Is it a good idea to do it with the instance_deactivate_all
as you show us in this tutorial? or should i create another room for it?

Reply

Hollow Depth

June 29, 2020

You, Rias on you background so сасная.

Reply

Tipoland Z

June 29, 2020

Your background is burning my eyes.

Reply

Biasface

June 29, 2020

nice background

Reply

Nathan Hall

June 29, 2020

I just wanted to say that I've spent many hours trying to figure out this concept, and your tutorial was the first thing that actually worked/helped me understand why it wasn't working before. Thank you!

Reply

Felicia Indest

June 29, 2020

Does this work for 3D games?

Reply

RinsDesk

June 29, 2020

🙁 it's not working for me. What have I typed wrong?
//Create
pause = false;

// Step
if (keyboard_check_pressed(ord("P"))) {
if (!pause) {
pause = true;
instance_deactivate_all(true);

} else {
pause = false;
instance_activate_all();
}
}

//Draw GUI
if (pause) {
draw_set_color(c_black);
draw_set_alpha(0.60);
draw_rectangle(view_xport[0],view_yport[0],view_wport[0],view_hport[0],0);
draw_set_font(fnt_score);
draw_set_color(c_white);
draw_set_alpha(1);
draw_text((view_wport[0]-96)/2,(view_hport[0]-96)/2,"Paused");
}

Reply

Joshua Plosz

June 29, 2020

Just to throw my 2 cents your way, these tutorials are helping me out a ton in my own game developing. You may not make much money from the lack of views but I've definitely subscribed at the very first gms2 tutorial I watched. These are quality tutorials that I've came back to troubleshoot some of the random issue's I've had. And I'm not even making a game that is anything like this shooter game (besides being top down). So for my sake and the sake of anyone looking for serious tutorials and not just entertaining video's, keep up the good work!

Reply

Beverly Lee

June 29, 2020

You are awesome at explaining everything! Please do more videos, especially for slightly more complicated mechanics. Also, please do the more complicated pause menu like you said 🙂

Reply

tankie

June 29, 2020

thanks for covering these gml functions 🙂 lot easier than I originally expected Lol

Reply

Hunter Davis Films

June 29, 2020

first. will you play my game

Reply

Leave a Reply