hi, I’m making a clicker game and I need to swap images from one to another and another during the game. The whole thing is written in gui scripts. What script to use and what paths and where to get the right names so that everything works for me
You can easily swap images in gui by using Gui play flipbook. You first add your images to an atlas then in the gui outline you can add the atlas to the “Textures” folder. After this you can assign your image(s) by selecting a node and in the outline properties you can select a texture.
Then in your gui script you can use
gui.play_flipbook(node,image)
to switch images. The name of the image file as set in the atlas will be the same name you use in the function as shown above.
I created a simple example.
gui_image_swap.zip (31.8 KB)
If you are looking to swap atlases you can find an example here
4 Likes