We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Use list to change texture on event of click

Home Forums Puzzles Use list to change texture on event of click

Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31022
    NilàNilà
    Newbie

    Hello,

    I am working on a configurator with tons of textures to chose for one object (over 80). For now i simply duplicate the puzzle “on event of click” with a “replace texture” inside and manually change the name of the element and texture.
    (see first screenshot)

    I am looking for a way to loop (in a way) the process with a list containing all the color names. I tried to use the puzzle “for each item” with the same puzzle as in the manual way inside. Changing the color by the variable “i”. (see second screenshot)

    It works in a way but only change the texture to the last color on the list no matter what element i click on.

    Using a list would make the work way less tedious and make it a lot faster that’s why i need help.

    Thanks

    Attachments:
    You must be logged in to view attached files.

    Nilà~

    #31029
    GlifTekGlifTek
    Licensee

    Hey Nila,
    This (last item in list) issue happens with other things like the drag puzzle, so I’m thinking the solution there might help you as well.

    Here’s the link to the answer to the problem there…
    Hope it works for your issue! :good:
    https://www.soft8soft.com/topic/add-dragging-and-methods-to-a-list-of-objects/#post-26503

    #31030
    NilàNilà
    Newbie

    Thanks,

    I was actually able to fix the problem by using a procedure with the on click event in then put this procedure in a loop. Idk why it works this way but as long as it does, i’m happy ;-)

    Nilà~

    #31031
    GlifTekGlifTek
    Licensee

    If you like, post an image of your puzzle solution for people that have the same problem. :yes:

    #31032
    NilàNilà
    Newbie

    [FIX]

    The way i found to fix it is to use procedures. you put the “on event of click” with all the parameters you want in. Then create a loop “for each item in list” with the procedure in.

    For me it’s supposed to be exactly the same but this way works and not the other.

    See the screenshot for the complete puzzle.

    Attachments:
    You must be logged in to view attached files.

    Nilà~

    #31043
    GlifTekGlifTek
    Licensee

    That’s awesome. Thanks for sharing, Nila!
    :good:

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.