-
Best way for make a full screen pause menu?
Im working on a game that requires a full screen weapon select/status screen type menu and im not quite sure how I want to go about doing it.
I need to find the best or quickest way to do this to make things run as smoothly as possible. The two ways I thought to do were:
Make all things on the screen pause, then create a full screen menu overtop and go from there.
or
Make the menu a seperate frame, and apon pausing, save all variables and locations into memory and load that frame then after the unpause, reload the previous frame.
If anyone has any tricks, or ideas to make this a bit easier, your help would be greatly appreciated.
-
Re: Best way for make a full screen pause menu?
You can use a sub-application object to have the best of both world - the pause menu is kept in a separate frame in your application, but runs over the top of the frame from which you call it, so you don't need to save absolutely everything when you jump to it.
Tiles has quite a decent example in the File Archive somewhere. One thing to remember when testing is that if the subapp points to a different frame in your application, it won't work when you "Run Frame" on its own.
-
Re: Best way for make a full screen pause menu?
Yes, sub-application works fine as pause window.
If you own MMF2 Dev you can also use the Dialog Box Object.
Don't forget to set the window style of the
sub-application to modal.
Ohterwise the game won't stop.
-
Re: Best way for make a full screen pause menu?
Thanks for all the great info, I seem to be getting the hang of it.
The only problem im having now is the Sub app will only pop up at the start of frame.(Because I haven't destroyed it yet) I have the sub app in Modal so it pauses the main app, and when im done with the sub app, I have it destroyed. When I press start again, nothing happens even though I am creating it again.
Is there a way to hide the subapp in modal mode, or am I going about this completly wrong?
-
Re: Best way for make a full screen pause menu?
It took me a while to work out how to use it - this is the general approach I use in the main frame:
Subapp should be set to Popup and Modal, and all Share boxes should be checked.
"Visible on start" for the subapp should be unchecked.
Start of frame: Destroy subapp
When (event to trigger subapp's apperance) and number of subapp = 0: Create subapp at (0,0) on top layer, show.
When subapp is finished (only one action when event loops): Destroy subapp.
I think that's everything - and within the subapp frame, use "End of application" to end the frame.
-
Re: Best way for make a full screen pause menu?
Thank you so much, that made it work flawlessly.
If you want to be in the Special thanks credits in my game, let me know.
*Does backflip*
WOOOOOOOOOO!
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by DavidN
Start of frame: Destroy subapp
You know, you don't actually need this. You can just delete the subapp in the frame editor. As long as you have a "Create subapp at (0,0)" action, all events will stay. It's not necessary, but it's less work and a subapp hanging around your frame is kinda bulky.
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by Hernan
You can just delete the subapp in the frame editor.
You can also uncheck the "create at start"-option in the
runtime options of the sub-app, so you don't need to delete the sub-app in frame editor.
i like the simplicity of mmf :)
-
Re: Best way for make a full screen pause menu?
Great thread! Thank you on my behalf, too. Finally, I can add a menu to my game.
EDIT: Oh, sorry. This thread is already one year old. I just looked at 18 August and thought it had been posted days ago.
-
Re: Best way for make a full screen pause menu?
I keep on pointing people back to it, so... nice to have it on the front page again for a moment, at least :)
-
Re: Best way for make a full screen pause menu?
Mine works just perfectly except for values.
In my frame "Level 1" I set my character's var L to 0 or 1. And M to 0 or 1.
When I press Esc the subapp is run...it has my character in it as well...and he is a global object. My subapp is set to "share variables" but it does not work. MMF2 cannot read the variables of my "Level 1" frame.
EDIT How do you go back to a screen when the subapp is running?
Jump to... lets the subapp jump to...but not the main app.
End subapp ends it and nothing else happens.
My main app is 1024x768, my subapp menu is a popup window with 180x280.
-
Re: Best way for make a full screen pause menu?
This is driving me nuts. I can't get it to work. It is the last one I have to code.
-
Re: Best way for make a full screen pause menu?
Well, I think the subapp is treated as a different "application" so can't read the values of global objects in your parent application... it can share globals and the other items that you can check off in its properties, so depending on the situation you could either store a couple of values there or use a save file to transfer data between them (using the Named Variable Object or an INI/plaintext file).
I'm not sure what you're trying to do in your second question... "End the application" from within the subapp will close the sub-application and restore control to your main application, as long as you have the "When subapp is finished -> Destroy subapp" event in your main frame.
-
Re: Best way for make a full screen pause menu?
-
Re: Best way for make a full screen pause menu?
I think there's an even better method - have the inventory (or pause screen or dialogue stuff or whatever) in a separate frame with "keep display from previous" checked.
When it needs to pop up, save the state of the current frame, save the ID of source frame somewhere and then jump to the frame with the inventory etc.
When the work is done, read the ID of source frame, load it's state and continue.
This way one can have slightly transparent menus, also there's no need to mess with an additional active picture that will load a snapshot of the source frame etc.
-
Re: Best way for make a full screen pause menu?
Hah, wow. I literally just logged in to ask about pause menus, and here's this thread. Timing FTW :D
More thanks from me :P
-
Re: Best way for make a full screen pause menu?
Actually saving frames and then loading them doesn't really work if one's app resolution is a bit bigger or there's lot of data ;_; there's a visible lag and some other minor problems, for example objects that are destroyed popping up for a split second (I guess before the frame loads) etc.
Too bad, it worked so nicely when I was just testing it!
-
Re: Best way for make a full screen pause menu?
(sorry to boost a week-old thread, but it seemed the most appropriate since all the stuff is here)
Ray, your method works really well for me, but I have one problem. I'm working on a platformer, and when I return to the original frame my character is suddenly unable to move, other than turning on the spot. This also happens in midair. Although it's a little amusing seeing my game character oddly suspended in midair, it's not too great for gameplay ;)
Do you know why this is? I'm using the Platform Movement Object. The character's animation also continues to play as usual, so the problem is purely with his movement.
-
Re: Best way for make a full screen pause menu?
No, in fact I'm battling with it at the moment but I have a feeling I opened Pandora's box of bugs including runtime crashing, screen flashing, path movement of my NPCs going completely off, objects disappearing and pasting themselves into the background...
The most frustrating part is that it stops crashing if I just change all my actives' movement from path to static, so I'm 99% certain this is a TGF/MMF bug.
-
Re: Best way for make a full screen pause menu?
I don't have any problems with crashes, flashes, or the like (woo rhyme :P ), it's just the platform movement object that seems to stop functioning
-
Re: Best way for make a full screen pause menu?
Sorry to necromance this thread again, but it is relevant to my interests. I have a number of ideas that I am thinking about starting and they all pretty much require a technique like this.
I think I understand using the subapp and all of that, but (without MMF2d in front of me) I guess I don't quite understand how to make an application and another application communicate with each other.
Does anyone have an example mfa they could share? This is a pretty perplexing technique that I really, really, really need to master to make my visions come to life.
Thanks :)
Edit: I am experimenting with it now, trying to understand it. I set up a blank frame with a bouncing active and set the Sub-Application object to pause the application when I press Q just to see if it would work...it didn't. What is the trick here? Can anyone help?
-
Re: Best way for make a full screen pause menu?
If you want a full screen pause menu, you can always modify my Pause Menu to do that.
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=107819#Post1078 19
-
Re: Best way for make a full screen pause menu?
Perhaps upload what you have so far to the File Archive and see if anyone can point out what's gone wrong.
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by dragonguy
If you want a full screen pause menu, you can always modify my Pause Menu to do that.
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=107819#Post1078 19
Yeah! I actually saw yours too and I have been playing with it. This is pretty much what I want to do, but integrating it in a game is where I am getting lost. I also wonder if it would be possible to do this in a way that doesn't take the whole screen, but that is a minor concern over making it just work :)
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by DavidN
Perhaps upload what you have so far to the File Archive and see if anyone can point out what's gone wrong.
Below is a link with the mfa I made in 5 mins just trying the concept. I must be doing this wrong...
thanks for the help! :)
http://www.gamersuniversity.com/wp-content/uploads/2008/12/pausing-test.mfa
-
Re: Best way for make a full screen pause menu?
The "pause the application" action is something separate (it doesn't tell the sub-app to pause the main application, as you look to be using it). You only need a subapp object in the frame you want to be pausable. It should be set to point to "A frame in this application", your pause menu, and to flesh out the instructions from before -
The subapp should be set to Popup and Modal, and all Share boxes should be checked. "Visible on start" and "Create on start" for the subapp should be unchecked.
Events:
When (the event to trigger subapp's apperance - User Presses Q in your case) AND number of subapp = 0: Create subapp at (0,0) on top layer, show.
When subapp is finished (only one action when event loops): Destroy subapp.
Within the subapp frame, use "End of application" to end the frame and return to the main game.
To get an image of what's behind the subapp in the main frame, you can use the Screen Capture object to save to a picture just before the subapp is loaded and then load this in a Picture object in the background of the subapp frame. It sounds mad, but it works.
-
Re: Best way for make a full screen pause menu?
I am confused, the way you are explaining it makes it sound like you are actually using two separate applications for this, and not just a frame within the application. Or are you?
-
Re: Best way for make a full screen pause menu?
The subapp object, though it sounds like a separate application (and is treated as one), can be set up to point to another frame in your application that contains the pause menu.
-
Re: Best way for make a full screen pause menu?
hi,
DavidN,
first of all, thanks for enlighting us in using subapp,
unfortunately I came across a problem by the end of the process,
the global variable doesn't transfer the value back to the main application, my little subapp can read my global value which I have assigned in the main application and its displayed in a counter, but it doesn't return the "new" value back when I end the application.
any solution to that? or anyone who can participate please ?
thanks in advance!
-
Re: Best way for make a full screen pause menu?
That's odd... the global variable should stay to whatever the subapp set it to when control returns to the main application. The most likely thing I can think of is that you have an event somewhere that's setting the global value back to what it was before the subapp started.
-
Re: Best way for make a full screen pause menu?
Isn't there a checkbox such as "Share global values and strings" is it checked ?
-
Re: Best way for make a full screen pause menu?
What if you want to make the pause menu transparent, or semi-transparent, over the main game? Is there any way to do that?
-
Re: Best way for make a full screen pause menu?
I found a way to make it!
but I have to keep the counter = global variable under ALWAYS
I wonder if its a good practice? because I dont like to keep things under ALWAYS except for few exceptions.
I dont know.. I will keep it that way and if I find a better way to refresh my counter or certian good conditon I will report back, for now, its working ! :)
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by DragonMC
What if you want to make the pause menu transparent, or semi-transparent, over the main game? Is there any way to do that?
If you're after some basic transparency, just use Window Shape (although be careful, if you use an Active object as a mask and then resize your application the Window Shape will still apply the mask from the original size of the Active Object). Otherwise you'll have to make a screenshot of your current app etc (already explained by DavidN elsewhere).
-
Re: Best way for make a full screen pause menu?
Quote:
Originally Posted by RayMarble
Quote:
Originally Posted by DragonMC
What if you want to make the pause menu transparent, or semi-transparent, over the main game? Is there any way to do that?
If you're after some basic transparency, just use Window Shape (although be careful, if you use an Active object as a mask and then resize your application the Window Shape will still apply the mask from the original size of the Active Object). Otherwise you'll have to make a screenshot of your current app etc (already explained by DavidN elsewhere).
Thanks!
-
Re: Best way for make a full screen pause menu?
Well the latest build finally fixed some bugs that previously made it impossible to have the inventory / pause in its own frame that you can summon any time you need without using the subapplication, screencapturing and the Active picture.
Without further ado let me present you a very nice way of making the pause / inventory menu:
Please take a look!
Basically this method uses the new "Save / Load Frame" functions to keep things organised.