Forum Discussion
How to create a show or hide feature on a layer
Hi All
I have a screen that has 3 layers plus the base layer.
Each layer has multiple clickable items. Each clickable item is supposed to show a text on that layer. Due to lack of space, I need each text to show when I click the item and hide when I click another item. I have converted each text into pictures and set their initial state to Hidden. When the object is clicked, the respective text image state changes to Normal. Is there a way to reset this state to hidden when I click another object? I have a total of 12 clickable items, so if I were to create "change state to hidden" for each item, that will be a lot of triggers. Wondering if there is an easier way of doing this.
May be I am looking at it wrong. Can you suggest a better way to implement this?
Thanks
LV
- SandeepGadamCommunity Member
Hello there, I advise making a button set for those 12 clickable objects instead of putting the pictures to a hidden state. Then, put each image in the selected state for the associated clickable button has picked. You can entirely prevent triggers in this method.
Please review the attached sample for your reference. Let me know if you need any further help!
- LakshmiVinay671Community Member
Hi Sandeep
Thank you so much for the tip. I did download the file but I am unable to understand the trigger/feature that hides the 1st image when the 2nd button is clicked. Can you explain this? I am sorry if it sounds stupid.
I think I forgot to mention that all images are required to appear in the same spot which means one image has to hide before the other one shows on top of it.
Attaching an image to give you a better understanding.
Thanks again.
LV
- SandeepGadamCommunity Member
Hi Lakshmi, I appreciate you giving the reference picture. I've since updated the SL file I previously provided you and attached it. This example is similar to the reference picture you gave.
If you are unfamiliar with button set, kindly click through this link to obtain a clear understanding of what it is. I created a button set and this creates selected state for each individual button.
The picture (text box) was then placed in the corresponding clickable button selected state once the button set was constructed, According to your specifications, I configured the size and location to be the same such that when you click the first button, the text box shows, and when you press the second button, the second text appears hiding the first text as per your requirement.
Please review the attached updated SL file.
Feel free to reach me at sandeepgadam@gmail.com if you're still unclear with my instructions.
Thank you!
- LakshmiVinay671Community Member
Good evening Sandeep
Thank you so much for the very detailed response. Tried it and it worked perfectly! Thanks a ton! You are a true saviour! :) Learnt something so valuable today.
Thanks!
- SandeepGadamCommunity Member
Hello Lakshmi, happy to hear that! Have a great day ahead!