0 Favourites

How do I Make an Event from One Layout affect the Other?

  • Basically in Layout 1 when you click an object it's supposed to update a number in layout 2, but doesn't. I tried to put the number in the same layout and that worked, but I want the number in a separate layout.

  • How do you store this number?

    If it's a variable on your event sheet, just make it Global, it should be visible to both layouts.

    You can also create an array or a dictionary and store your number there, or you can add an instance variable to some object accessible from both layouts.

    The dictionary would probably be the best solution.

  • How do you store this number?

    If it's a variable on your event sheet, just make it Global, it should be visible to both layouts.

    You can also create an array or a dictionary and store your number there, or you can add an instance variable to some object accessible from both layouts.

    The dictionary would probably be the best solution.

    Capx Example by any chance?

  • Here you go:

    I tried to make it simple as I understand you are new to this.

    Of course many things can be optimized there because both layouts are very similar and share most of the code.

    You can move repeating pieces of code to functions, or you can even make both layouts to use the same event sheet.

  • Here you go:

    ... .capx?dl=0

    I tried to make it simple as I understand you are new to this.

    Of course many things can be optimized there because both layouts are very similar and share most of the code.

    You can move repeating pieces of code to functions, or you can even make both layouts to use the same event sheet.

    Thank you so much, I'll check it out

    Edit: I'll update in a day or so if I can get this working in my game, thank you so much for taking your time to do that I didn't expect it to have so many events.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I didn't expect it to have so many events.

    That's because there are 3 examples - using a variable, dictionary and array.

    And, like I said, most events are identical in both layouts.

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