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
G
1
Posts: 15
Reputation: 691

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
33
S
7
G
6
Posts: 34
Reputation: 4,815

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
192
S
6
G
7
Posts: 213
Reputation: 10,178

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
Posts: 22
Reputation: 751

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
Posts: 22
Reputation: 751

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.
English is not my native language. Sorry for any mistakes and feel free to correct me if needed.
B
14
S
5
G
3
Posts: 110
Reputation: 3,225

Post » Sat Mar 10, 2012 6:57 pm

Thanks!
It worked like a charm.

B
5
G
1
Posts: 15
Reputation: 691

Post » Sun Mar 11, 2012 3:19 am

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


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], DiabloOvermind, emoticon and 16 guests