Go to Layout VARIABLE

For questions about using Classic.

Post » Tue Mar 22, 2011 6:49 pm

Hi,
is it possible to go to a layout but not typing a number into the edit menu but through a variable. For example when i press the button it should jump to the layout number i saved in a global variable. For example my variable is "value" and the value in it is 5.

On Click Button 1 --> System Go to Layout global('value')

but doint this nothing happens. The value is saved like this in the variable, as i tested with a text field but i just dont jump to the layout i want it to.
Thank for you help,

Unknown1111
B
1
G
1
Posts: 9
Reputation: 443

Post » Tue Mar 22, 2011 7:07 pm

Entirely posible. I have mine set up using text so I can shuffle levels around without breaking the connection.

Possible errors are

Is there a keyboard object on your layout?
Is the event sheet connected to the layout?
I think the level 'numbers' are 0 index, so you may be using the wrong number.

Run the debug menu and check that the global variable is being set correctly. Set up another method of changing to the same level to test that is all working correctly.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Mar 22, 2011 9:44 pm

It may not accept integers, and I think it may be case sensitive as well.
"Layout 2" should work where 2, or "layout 2" might not.
Just depends on how you have it named.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Mar 23, 2011 7:38 am

okay awesome :) now it works, thanks a lot for the quick help!
B
1
G
1
Posts: 9
Reputation: 443


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests