Make button permanent visible after unloading scene

Hi,

probably there is an easy solution, but I cant’t find it. Is it possible to make a (opacity 0%) button permanent visible after unloading a scene. I mean if you reload that scene the button must still be visible.

thank you

I can not follow your thought pattern here… a button with 0% opacity won’t be visible no matter what the circumstance - though it will be able to interact in a scene assuming nothing covers it. Do You have an example of what You are trying to achieve?

Hi Jim,
thank you for looking into it. What I want to achieve: there is a button on a scene. 0% opacity or maybe outside the visible area. After unloading the scene, the button must be visible (make opacity 100%, I know how to do that) the next time people visit this scene. So it then becomes permanent on the scene.
It might also be possible to have a symbol, because I need this to happen on more scenes.

Hi Djon!

Got the concept… but it is after Midnight here in California and I’m closing down and won’t be back on for another 12 hours or so… perhaps others will chime in. My initial take is a persistent Symbol with JavaScript flags (display) set at Scene Load~Unload. You may not even need to go the Symbol route. In the project I am working on I have one single “Close” box for over 30 separate interactive graphic panels & 15 videos that appear in (4) different scenes. This “Close” box just floats on top of everything waiting to be called - but whether “On” (Visible) or “Off” (Hidden) the opacity is always 100%.

A demo of your set-up, even if very basic, would be helpful.

Here is what I want to do. Buttons not visible in scene 1 and 2. (I’ve made them slightly visible for now) But after reaching scene 3 and returning to scene 1 or 2 buttons must be visible and remain visible even after leaving the scenes again.
I found a solution by copying the scenes and put the button on the copied scene and point to that scene from scene 3. But I don’t think this is a very neat solution .
buttonVisibleAfterSceneUnload.zip (22.3 KB)

This is one way to do it.

It’s not attached to an unload. But, it checks for a “flag” (as JimScott put it) which is a variable, hidden. If this variable is true then the elements are hidden. If it is false then they are not. The elements in my example are hidden on first load when you get to scene 3 they are revealed and stay revealed until you change the variable back to true. You can do this with another function on another scene load or mouse click. Also the elements that are hidden are done so by giving them a class of hidden. So you can do this with any element that has the class hidden.

hiddenElements.zip (40.4 KB)

1 Like

Hi Bear, thank you for your help. It works pretty good but there is a problem. I implement this in an app. I use local storage to get back to the page you left. If one closes the app completely (double click and swipe off), after starting again it returns to the last page, but then the button is gone. Same thing happens when refreshing in browser. Any idea?

just put the variable (hidden) in localStorage too.

I am using your localStorage example. Not sure where and how to put the variable.

Ok. @Djon My example wasn’t using localStorage. But this one is:

hiddenElements-v2.zip (40.6 KB)

1 Like

Thank you very much. I’ll put it in xcode it and play untill the final scene on the iPad. Will let you know the outcome tomorrow. Have a good night. Not sure what timezone you’re in though :slight_smile:

Works perfectly. Thanks again.

Hi @DBear.
Thank you for this demo and the file.
I have 2 symbols and I want to show them on the scene 1, but one after the other, e.g. the symbol 1 after the scene 3 and the symbol 2 after the scene 4, but I am not getting the right result...
hide - show - local storage.zip (41.0 KB)
Could you, please offer me support with this?
Thank you.
Ionut

Hi @ionutilie

This is quite an old post so some things may have changed:

i.e localStorage can only store strings. In the original I was using a boolean which at the time must have worked.

Also, I am not 100% sure as to what you need. You say "show them on scene 1" but "1 after the other" and then "1 after scene 3" and "2 after scene 4"

I'm unclear on what you are asking. Is it to see nothing until scene 3 when you want to see symbol 1 and then scene 4 you want to see symbol 1 and symbol 2?

Here is a quick re-work of your hype document.

hide-show-DBear.zip (56.8 KB)

This basically doesn't show the symbols until scene 3 and scene 4 the first time and then they are shown on all scenes

There should be enough for you to work out what you need. If not, maybe you can explain a bit more and we can see what can be done.

A lot has changed in Hype since this original post so there may be another way to achieve what you need.

2 Likes

It is perfect, @DBear!
You save my project! :partying_face:
Thank you!