How do I make popup window?

Get help using Construct 2

Post » Sun Dec 21, 2014 10:48 pm

ok, funny thing. I tried something new and it worked (partly - as usual :roll: )
I just use layers and spirit. No variables and Buttons

Main Page:
Icon "Sub2" and the submenu 2 is working. All Spirits are deactivated and are not disturbing the other layers

Icon "Sub1": All the submenu layer and Spirits within in the submenu are working, also no disturbing.
Problem: the Icon in Main Menu "Sub1" conflicts with the "Icon 3" of the submenu1. So if you click the upper part it goes direct to submenu1_1 instead submenu1

I don't see any difference between Sub1 and Sub2. Maybe somebody finds the Problem/difference??
You do not have the required permissions to view the files attached to this post.
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Mon Dec 22, 2014 1:08 am

@edwardr

Are you tring to create a menu with options and others stuffs? Because I still need to do it as well and I think setting a layer as global and only using groups is enough to build one I guess.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Dec 22, 2014 8:48 am

I'm trying to do a menu with Options (e.g. what do you want to build/upgrade, ... ).
If I understand how it works, I would like to include some submenu.

e.g:
Player has several icons (buildings/empty spaces).
Click empty spaces: what do you want to build: Hotel, shop, Airport, Military, ...
Player choose Military: what do you want to build: Airport, defence, Radar,...
Player choose Radar: Radar will be build, thank you, go back to menu

or

Click building: you choose Radar
do you want to upgrade, destroy ?
what do you want to upgrade ?
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Wed Jan 07, 2015 9:11 pm

I'm still working on it.
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Mon Feb 16, 2015 4:56 pm

Hi,
I didn't solved all problems, but I found a pretty good one. Somebody mentioned group, so I worked more in this direction.

I will describe now how to make "windows" / layers and deactivate all other icons using groups, layers, function() and families. (which simplify everything)

1.) Make a family (e.g. F_Icons) and all the buttons you will to need to go the next window/layer.
2.) Go to the family properties and add a Family Instance Variable (e.g. ID - text variable)
3.) Click the buttons in the family and add in the Instance Variable names (e.g. Menu_1, Menu_2, Menu_3,...)
4.) EVENT: the programming:
4.a) add a group (e.g. Menu_1) and put all the programming you need
4.b) add a group (e.g. Menu_2) and put the other programming, and so on...
5.) LAYER: the design
5.a) add a layer with the name (e.g. Menu_1) put all the text, images, and whatever you need in it. Check it if its really in the layer (you can see this in the properties)
5.b) if you use an icon several time in different groups, think about cloning/copying it or start the group to make it visible and end the group to make it invisible (sometimes it happened that I could see the icon (but not use it) in another group, so I cloned it.
6.) set all layers invisible and groups deactivate
7.) in the eventsheet put following command:
Code: Select all
       Function on Menu: set group"Menu_1" deactivated
                         set group"Menu_2" deactivated
                         set group"Menu_3" deactivated
                         set layer "Menu_1" invisible
                         set layer "Menu_2" invisible
                         set layer "Menu_3" invisible
                         set group Function.Param(0) Activated
                         set layer Function.Param(0) Visible
       on left button clicked on F_Icon:    Call Menu(F_Icons.ID)    (<- add parameter F_Icons.ID)


now it should work

for newbies (description):
I put all buttons into a family. So I save the programming for each button. On click, open group, hide rest,...
by adding a ID for each button, I know which button is clicked
now when you click one button of the family "F_Icon" it opens a function"Menu". (it's a kind of a sub-program, which deactivate all groups and hide all layers at the beginning.)
by adding the parameter (F_Icons.ID). The ID of the button is send to sub-program and can be used with function.Param(0) (<- 0 stands for the first variable, you also can you more variables)
because the ID has the same name like the layers and the groups, I just need to say activate the group with this name and show the layer with the same name.

I found also other ways, but there are some small errors in it. Don't ask why.
PS: sorry I don't have now the time to make a sample, but I hope the description will help
B
15
S
4
Posts: 77
Reputation: 1,030

Previous

Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 44 guests