0 Favourites

Pause Menu implementation using different layouts

  • I'm looking into many ways to create pause menu. While we can simply set timescale to 0 to make everything simply freezes. I want to look into furthere possibilities.

    My pause menu consists of several information and I want to go for wysiwyg on another layout. Rather than creating some pause objects and freeze the game, I think it would be better to create the pause menu on another layout, especially when your pause menu is complex like some Final Fantasy game.

    Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places.

    How can I do this in C2?

  • I can tell you 2 easy ways to do this.

    First the really easy one and fast one.

    1. Make a "Main" group, put all the events out of the Layout in this one.

    2. Add another Layout + Event sheet

    3. In the new Layout:

    -> Create all sprites that you need in your pause menue(includes the pause button)

    -> Set all objects global

    4. In the Event sheet

    -> On start event that creates the pause button

    -> onclick event that disable your main group

    -> dynamicly create the pause menue like (set position menue (layoutwidth/2 ..))

    -> insert all events that you need in the pause menu

    -> onclick event that reactivate you main group

    5. Now you just need to insert the event sheet in every other Eventsheet there you need the menue ;)

    You can also use this menu in every other project there you want ;)

    PS:

    "Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places." // I really dont understand what you want ^^

  • I got some of your key ideas there. But I don't get it why do you need global there. Also, creating a dynamic menu is something I want to avoid cuz I wanna go for wysiwyg.

    Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places." // I really dont understand what you want ^^

    Imagine megaman's pause menu in later installment, which we have the pause menu taking over the whole screen. When the player is done with the menu, the game returns to the "current layout".

  • See the manual for options on persisting objects and layouts for your second question. It was added in the same update as the save system.

  • He means dynamic menu as in it is not tied to one layout. You visually create it, but then can dynamically call it from any layout. You make it global so that it is available across layouts.

  • kerberoes All what you want will be done with my idea.

    At me you dont save the game to go to a different Layout, no you just pause the game and pop up a menue other it.

    The sprites need to be global, so they can get loaded in you current Layout. Let?s say something like this LINK

    So you have 4 global objects, 3 Buttons and 1 Background.

    Create them on the new Layout and get them in one container.

    So in your event sheet you just have 1 action:

    -> Set position background (0, 0) Layer HUD!!!

    Do you want an example ?

  • e means dynamic menu as in it is not tied to one layout. You visually create it, but then can dynamically call it from any layout. You make it global so that it is available across layouts.

    Since pause menu is to be dynamically created and destroyed upon called/dismissed, why do we need it global?

  • Without you need to insert on every Layout all sprites that you need for the menu.

  • Wait, let me get this right... I recall for objects in Construct Classic, we need to set global to objects to make some objects available in all layouts, but in C2, all objects are already available to all layouts. And global setting just prevent objects from being destroyed when we change layout, isn't it? Correct me if I am wrong.

  • No they are not, it?s right that they doesn?t get destroyed when you change the Layout. You can use them on every Layout, but in this case you want to save their position.

  • I might be missing something here. Because from here: scirra.com/forum/topic66390.html , it has been stated that objects are available in all layouts.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Save their position? Now, that's vital to this thread. I shall give that a try. Thank you for the info.

  • Ups my failure, this got changed. You?re right ok, you don?t need to make them global :D I?m a typical programmer and so it makes for me no sense that non global objects, are global available.

    PS: Yes try it, this will work. With or without globals.

  • So you have 4 global objects, 3 Buttons and 1 Background.

    Create them on the new Layout and get them in one container.

    So in your event sheet you just have 1 action:

    -> Set position background (0, 0) Layer HUD!!!

    Set position background or System create background ?

    And how to position all the other container's elements ? If you have 20 or more elements, do you have to do Set position for each ? I can't find a better method. <img src="smileys/smiley19.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
80 46,960
playtingz's avatar
playtingz
Unread hot topic
132 29,606
chadorireborn's avatar
chadorireborn
Unread hot topic
52 8,563
BluePhaze's avatar
BluePhaze