This is an updated version of my Previous Thread, in which I described how to make a gif using textures and texture offsets, this is both a tutorial and a resource, much like the previous post, so I will be making the post here, like the previous post
Additional notes: This is an example resource showing you how to do this, not necessarily how you should do it. If you have a better way to load or animate Spritesheets, do it, this was not built for performance.
Hello, recently people have been messaging me about my “Gifs in roblox with only 1 image thread” in which i explained how to use textures and texture offsets to load a sprite/“gif”, asking for how to do this for guis, I was a bit shocked by the amount of people who didn’t already know this, and since that old thread is still receiving those replies, I have made a quick and easy resource to load sprites into a gui.
This tool is extremely simple to use, and works on the same principle as my old spriteloader, but for guis.
How to:
First step: Convert your gif into a spritesheet if you’ve not already done that. A good tool for this that I used in the making of this example can be found here: Turn gif into sprite sheet
after you convert it to a spritesheet, you should get something like this:
before we do anything with loading this sprite, we need to know some details about it
Rows, Columns, And frames.
Columns are the amount of frames going horizontally, as we can see from my beautiful example, this gif has 4 columns, to get the amount of rows, thats the amount of frames vertically in the example, so we can see here, we have 4 rows with an incomplete 5th row. When making a sprite, you include incomplete rows. This means we have 5 rows and 4 columns.
To get the amount of frames, you could just count them all, but an easier way is to multiply the complete columns by the complete rows, and adding frames from the incomplete last row, so for us, we have 4 complete rows, and 4 complete columns, and 2 extra frames on the 5th row, so we can simplify this and get 4*4+2, this was apparently more difficult to understand in my last thread, so I wanted to explain more in this one.
After that you can plug them into the script which explains how this works in much greater detail than here, but if you read it you will see its actually extremely simple, thank you for reading my thread.
Models to view
spriteloader.rbxm (5.5 KB)
And the place used in this example
Sprite loading example.rbxl (31.5 KB)