Getting a popup to appear...?

0 favourites
  • 7 posts
  • I've created a ratings popup (five stars and a submit button) that I want to popup over my main game screens when the user presses a button. I've created this on a separate layout.

    How do I get it to appear over the other game screens? Do I save the layout in different way and call it as something else? Perhaps as an object in it's own right?

    Thanks all :)

  • It depends on what kind of app you develop and when the window should pop up. But you can not spawn a layout in another layout. So you would have to change the layout and save the entire state beforehand, and then return exactly where you were. I think it would be easier to spawn a window on a layer with parallax 0x0. Maybe this will help you:!Ap_-qxoGKbDcg1-e8yZG2Q-lLEux

  • kriand - brilliant, thanks for the example.

    My rating popup is composed of several components (white background panel, copy, stars, submit and close buttons - see linked image) - is there a way I can call these as a single object or group rather than having to call each element individually?

    Edit: To clarify, on event 3 you create object PopUp - is there a way for my full popup with all it's components in place to be called up as a single object?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can put your popup and all elements in a container. When spawning one object, all the others spawn too, but you still have to align them. However, you can minimize the effort by creating an image for your popup that contains all the elements that do not need to be moved or otherwise changed.

  • Yeah I've just discovered containers.

    In regards to aligning them - how do I do that? On the original layout all the elements were aligned when I created the container. Now with the popup all of the elements appear at the bottom of the screen apart from the white background panel which was the basis for the container - that now slides up the screen when the popup is called.

  • Create a Sprite and load your popup image. Then add some image points, for every element one. When the popup is created, set the postion of each element to the matching image point either every tick or by using pin behavior.

  • Bootfit

    You might want to take a look at Global Layers, as this will allow you to have the pop-up designed in a separate layout and appear in other layouts by overwriting the layer with the same name.

    You'd need to make the layer invisible and disable it's events on start and then make it visible and enable the events when you want to show the pop-up

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)