Using Materials dynamically
-
Hello,
I'm trying to create a dynamic component that mimics the functionality of the 'Art Frame' dynamic component that Google created. Basically it is a dynamic component of a frame picture. Each time you click on the frame the 'artwork' material changes.
If I understand correctly, this behavior comes from the components 'onClick' behavior that is currently: SET("ArtCount",1,2,3,4)
To me this says, rotate the material between 4 different options.
What I cannot figure out is how to create this to begin with. I see a 'Custom' section in the components attributes section that has a 'ArtCount' property that is set to '4'. What I don't understand is how to designate each material. Is it a hidden face that has a tag that identifies it as item #1 or 2 and is unhidden in response to a 'dynamic click'?
I'm happy to absorb a video or other tutorial, I just can't seem to find what I'm looking for.
Thanks so much.
-
It's not a hidden face exactly - there are 4 sub-components which are being made visible/hidden depending on the value of the ArtCount attribute.
The onClick is just cycling the value of the ArtCount attribute through 1 - 4. Nothing more to the onClick than that.
Then each of the 4 Components which contain the images looks at the value of ArtCount to decide to be hidden or visible. These 4 components use the built-in HIDDEN attribute to decide to be hidden or visible.
"Mona" Component:
Hidden: =IF(ROUND(PictureFrame!ArtCount)=1,FALSE(),TRUE())means if ArtCount equals 1, then
HiddenisFALSE, and Mona is visible. -
Awesome,
Thanks for your help.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement