How to add custom pop-up window

Get help using Construct 2

Post » Mon Mar 11, 2013 2:44 am

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:




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!

HAXX0RZ2013-03-11 02:45:35
B
6
S
1
Posts: 10
Reputation: 774

Post » Mon Mar 11, 2013 3:10 am

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.
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Mon Mar 11, 2013 3:35 am

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 :)
B
6
S
1
Posts: 10
Reputation: 774

Post » Mon Mar 11, 2013 4:27 am

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Mar 11, 2013 4:29 am

[QUOTE=Kyatric] 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.[/QUOTE]

@Kyatric that's bad practice IMO.


I suggest to use function to create the objects when it completes the level.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Mon Mar 11, 2013 4:35 am

@Joannesalfa: It's not a bad practice if you're organised.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Mar 11, 2013 4:43 am

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

I'm sure it's really bad practice.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Mon Mar 11, 2013 8:08 am

@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...
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Mar 11, 2013 8:26 am

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.TheStoepsel20012013-03-11 08:29:57
B
6
Posts: 33
Reputation: 816

Post » Mon Mar 11, 2013 9:27 am

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.
B
45
S
15
G
9
Posts: 1,096
Reputation: 11,038

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], kamens503 and 26 guests