logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Arrays across scenes

    Scheduled Pinned Locked Moved
    Help and Support
    4
    7
    309
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Stuart_McKayS
      Stuart_McKay
      last edited by

      Hello all,

      I’m hoping there is a quick answer to this and that it is possible.

      I want to store data in a number of arrays that can be accessed by a number of different scenes.

      My plan was to put some main arrays in to a scene specifically for it and retrieve/modify data directly from those scenes. I’ve tried doing a number of things such as broadcast etc but I expect this may not be working because the scene with the arrays isn’t loaded.

      Has anyone else done this? It seems like the best way to manage lots of different arrays needing accessed by lots of scens.

      Anyway, thanks in advance for your help.

      Stuart_McKayS 1 Reply Last reply Reply Quote 0
      • Stuart_McKayS
        Stuart_McKay @Stuart_McKay
        last edited by

        I think I may have answered my own question. By using the save to and load from file option. Only downside is that that I would need to load the scene first to save the array so it can be accessed later by scenes.

        Aidan_FireA 1 Reply Last reply Reply Quote 0
        • Aidan_FireA
          Aidan_Fire @Stuart_McKay
          last edited by

          @Stuart_McKay Yep, what you’ve found is the only way to share information between scenes, save and load to file.

          1 Reply Last reply Reply Quote 0
          • KamdroidK
            Kamdroid
            last edited by

            @Stuart_McKay @Aidan_Fire You can also use Global UI objects to share information between scenes.

            For example, you could place a label in Global UI layer, and use that as the shareable array between scenes.

            Here's a quick example I've made (if it doesn't open, long-press the link and tap Open Link):
            Share Global Array Example.tap

            This is just a basic example. You could also utilise Broadcast/Receive Message behaviours for more advanced functionality, e.g. auto-updating information when the array changes.

            Stuart_McKayS Aidan_FireA 2 Replies Last reply Reply Quote 1
            • Stuart_McKayS
              Stuart_McKay @Kamdroid
              last edited by

              @Kamdroid Ah ha, good shout, I may experiment with this a bit more.

              RobinsonXR 1 Reply Last reply Reply Quote 0
              • RobinsonXR
                RobinsonX @Stuart_McKay
                last edited by

                @Stuart_McKay As already suggested above, you can save and load data via the save to file and load from file behavior. You can also store attributes on a global object and switch scenes, as long as the global UI doesn't reset.

                Another way you can do this is put the array in the global behaviors. Global behaviors are behaviors that are shared across all scenes - they can be accessed by clicking on the globe icon in the scene editor.

                1 Reply Last reply Reply Quote 0
                • Aidan_FireA
                  Aidan_Fire @Kamdroid
                  last edited by

                  @Kamdroid Literally no idea why I haven’t tried that yet, and if I have tried it no idea why I’m not doing it.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post