How do I set a dynamic page layout variable?

  • In the comments section of this tut Kyatric posted a really simple "switch to layout" capx using an instance variable which works a treat.

    As you can see, you set a static variable "PageToGo" per instance as follows:

    Simple, easy to understand and effective. Great for simple page-turning buttons

    What I want to achieve is a little more complicated, that is, to have a single Layout which serves as a bridge been any two layouts. When a layout has been completed it automatically moves on to the "bridge" layout which stops until you press "go to next level".

    So... on this "bridge Layout", how do I set "PageToGo" as a dynamic variable based on the last layout completed? I know it must be possible, but it's the syntax that escapes me. As I understand it:

    • the instance variable shown in the clip above doesn't accept expressions
    • I can't use "Go to next/previous layout" because that will always be the layout after/before the "bridge" layout

    Many thanks in advance for your help!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You'd use "Go to layout (by name)". Just build up the layout name as a string: Goto "Page"&PageToGo

  • OK, I'll try that now, thanks!

    Edit: done that and it works a treat! Thank you!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)