0 Favourites

How to add custom pop-up window

  • Hello! I'm new to Construct 2 and I'm finding it really convenient to create quick games in it. :). Though I encounter one problem I don't know how to do:

    Is it possible in Construct 2 to create a custom window that pops-out whenever I player finishes the level? It appears something like this:

    <img src="http://2.bp.blogspot.com/-WuYVp9JMgZ8/UJ66cHclXOI/AAAAAAAAAQY/0iAsUHNGq_I/s1600/Get-3-stars-on-every-level-of-angry-birds.jpg" border="0" />

    Not only limited to level complete screens though, it can go in some ways like an 'Are you sure' window, or a 'You don't have enough money' window.

    I've tried Layouts, but haven't gotten them to appear right on top of the existing layout.

    Help will be appreciated, thank you!

  • You'll probably want to use a function for that. Create a "On function" condition, and on the actions add all the "Create object" you want and position them accordingly.

    Then you just need to use the "Call Function" action whenever you want all that to happen.

  • I was able to fix it recently with the use of Pin Behavior, but went on repetitive event calls. Thanks for the heads up regarding the Function command, I completely forgot about it :)

  • You may also want to make a layer that you make invisible on start of layout and only display (make visible) when the player completes the level.

  • You may also want to make a layer that you make invisible on start of layout and only display (make visible) when the player completes the level.

    Kyatric that's bad practice IMO.

    I suggest to use function to create the objects when it completes the level.

  • Joannesalfa: It's not a bad practice if you're organised.

  • Kyatric What happens if these buttons are invisible before to click/touch?

    I'm sure it's really bad practice.

  • Joannesalfa: what about them ?

    I'm really sure it's a matter of organisation.

    If you don't want the buttons to be pressed when they are invisible, just add a condition to check they are visible when clicked...

  • What I do is I create the overlay/popup outside my viewport (i.e. somewhere where the camera never goes), put all the Buttons and Labels etc. on top using the Pin-Behaviour and then move it to the viewport when it is supposed to appear. That way you never have any problems that you might trigger a invisible button. As Kyatric described above, it requires some level of organisation, but it turns out to work quite well...

    However, if you encounter any performance issues in your specific game and want to save ressources, try going down the road Joannesalfa described. It'll save you some GameObjects during gameplay until you really need to display them! ;-)

    Just an additional idea to stay organized: You might want to put the "Popup-Events" (triggering buttons etc.) into their own group: That way you can activate and deactivate them with a single activate group action in your EventSheet.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I cant see how its bad practice as there are many ways to achieve the same result, and using groups easily allows objects on a hidden layer to be disabled or enabled as required.

    I do think it would be a good idea to allow an entire layer to be enabled or not. Meaning any input wouldnt be detected on a hidden layer.

  • TheStoepsel2001 is right, if you plan to target for mobiles, use creating objects method, not hidden layer.

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