how to goto next layout..

Get help using Construct 2

Post » Sat Mar 10, 2012 8:55 am

Hi!
I`m making a game with a lot of layouts and I`m trying to find a way to switch to the next layout without specifying the layout name. I simply want the game to goto the next layout in order so I can use the same button to proceed through the game.

/PixlSlave
B
5
S
1
G
1
Posts: 15
Reputation: 841

Post » Sat Mar 10, 2012 12:25 pm

Just a guess, not sure if it really works:
You could name your layouts using numbers (1,2,3...) and proceed to the next layout using the str(currentLayout++) function, where currentLayout is a global variable (integer).
Or you use the array and fill it with all the names of your layouts, then just iterate through the array...
B
34
S
9
G
6
Posts: 34
Reputation: 5,133

Post » Sat Mar 10, 2012 2:35 pm

Here is an example of what @drpool is saying, and yes it works!

http://www.box.com/s/yx6db98tnonbzglez2nk

name your layouts a name like Level and a # like "LEVEL1" Create a global var, Then on event that triggers going to new layout, goto Layout by name "LEVEL" & global var
B
193
S
6
G
7
Posts: 213
Reputation: 10,203

Post » Sat Mar 10, 2012 6:16 pm

I have a slightly related issue.

I created a screen which will be character selection, and for the time being, I just want it to go to the main layout, but I seem to have done something wrong as it doesn't go to it.

http://dl.dropbox.com/u/66278067/spacegog6.capx

Any help would be much appreciated.
B
6
S
1
Posts: 22
Reputation: 901

Post » Sat Mar 10, 2012 6:22 pm

Sorry, that link was a version where the whole thing was broken. Here is the correct version with the issue I just described:

http://dl.dropbox.com/u/66278067/spacegog7.capx

Also, is there any way I can edit posts so I don't have to double post?
B
6
S
1
Posts: 22
Reputation: 901

Post » Sat Mar 10, 2012 6:44 pm

Within buttons, you can't use Mouse > left click on button... Instead of this, remove this condition and Add> Button > On clicked.

It will work :)

To edit your post, just click on the wrench (Post OPtions) and choose Edit post.
B
18
S
7
G
4
Posts: 154
Reputation: 4,113

Post » Sat Mar 10, 2012 6:57 pm

Thanks!
It worked like a charm.

B
5
S
1
G
1
Posts: 15
Reputation: 841

Post » Sun Mar 11, 2012 3:19 am

Thanks man, you're a star!!!!!
MonstaMunch2012-03-11 03:22:08
B
6
S
1
Posts: 22
Reputation: 901


Return to How do I....?

Who is online

Users browsing this forum: Kyatric, sinoscuras and 8 guests