What is ImageRectOffset and how does it work?

Hello! I want to make it so that my game background Image will keep moving towards a certain direction repetitively, and infinitely without stopping, How can I do this with ImageRectOffset and what is it, how does it work?

2 Likes

I believe there is a documentation on it: here

This is confusing, I don’t feel like they explain much about it in their.

ImageRectOffset combined with ImageRectSize and some math you can make a GIF.

ImageRectSize: Crops the image so that it can be seen from one coordinate to another coordinate in pixels.
ImageRectOffset: will move the image given by ImageRectSize in pixels.

This is the image that Roblox gives, it measures 1024x1024

as the example on the page says, it will divide it into 12 frames of 256x256

the table it gives is how many frames it will jump to show such an image, internally it would look like this

11 Likes

What about just one image, like this for an example

How would I make it so all of the little tiny logo children can keep moving somewhere infinitely, or give off an illusion at least ( My Wording is trash and Idk how to compile that but I have it in my head )

Should something like that remain?

Just take the first picture from row 1 and 2.

robloxapp-20210905-1346141.wmv (2.6 MB)

Something like that

More or less, this would work for the image above

Script
local Number_of_frames = Vector2.new(10,0)
local Frame_size = Vector2.new(192, 1080)
local ImageLabel = script.Parent


ImageLabel.ImageRectOffset = Vector2.new(0,0)
ImageLabel.ImageRectSize = Frame_size

local Info = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
game:GetService("TweenService"):Create(ImageLabel, Info, {
      ImageRectOffset = Number_of_frames * Frame_size
}):Play()
3 Likes

why does it zoom in and then fade into white or grey lol

Can you put some comments in the script? I’m a little confused on how some of the things work and I still want to learn