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

    Reacting to an overlay being closed

    Scheduled Pinned Locked Moved
    Help and Support
    3
    5
    190
    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.
    • StanicaS
      Stanica
      last edited by Stanica

      I have an overlay that allows you to buy items from a store and I need to update my UI in the scene below after closing the overlay. I've tried opening the overlay without pausing the scene and broadcasting a message, but the scene doesn't pick it up. I can set up a timer to periodically load a file and check if its contents have changed but this feels very inefficient. Any ideas?

      SplitMindGamingS 1 Reply Last reply Reply Quote 0
      • SplitMindGamingS
        SplitMindGaming @Stanica
        last edited by

        @Stanica I tried this also as I have an overlay I use to buy upgrades for my main character. I tried the broadcast message and it also doesn’t work. You have to use save file and load file but the problem with that is it’s not instant as you are experiencing right now without adding a timer. What I had to do was create the overlay layer entirely on the U.I layer which just looks really messy. Would be nice if overlays worked on real time prior to the scene you are currently playing.

        StanicaS 1 Reply Last reply Reply Quote 1
        • Aidan_FireA
          Aidan_Fire
          last edited by Aidan_Fire

          I also had this problem once, I think saving and loading is the only way to send data between scenes/overlays.

          I use an overlay as my UI for one of my games because it's the main menu UI, it disappears when the game starts. This way I can run a 0s timer to load the file (so the main menu isn't really efficient) but the timer turns off once the game starts. If your game is sort of meant to pause while the Shop UI is up, just run the load behaviour on a 0s timer I don't think it matters too much if your game is running a bit inefficiently while you're paused or in a shop, just turn off the load timer once you're done.

          StanicaS 1 Reply Last reply Reply Quote 0
          • StanicaS
            Stanica @Aidan_Fire
            last edited by

            @Aidan-Oxley I never considered disabling the timer after it ran. Thanks!

            1 Reply Last reply Reply Quote 0
            • StanicaS
              Stanica @SplitMindGaming
              last edited by

              @SplitMindGaming For one of my modals I did the same thing you did and created the "overlay" on the UI layer. Messy but it works.

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