I’m trying to create an infinite scrolling pattern on some gui using the Tile ScaleType mode and as little code as possible (for optimization and such).
I saw this topic How to make moving UI effects but it’s solution ended up moving the entire imageLabel rather than the tile texture.
The desired effect I want can be seen in the initial post of the linked topic. Is there any way I can create such a simple tween?
elseif object:IsA("ImageLabel") and object.Name == "DetailStripes" then
TweenService:Create(object, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1), {Position = UDim2.new(0, -52, 0, 52)}):Play()
end
Increase the size of the imagelabel to something like UDim2.fromScale(2, 1), so that it doesn’t cut off.
I’ve tried that, it no longer cuts off but I lose the seamlessness I want.
Try this
elseif object:IsA("ImageLabel") and object.Name == "DetailStripes" then
TweenService:Create(object, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1), {Position = UDim2.fromScale(-1, 0)}):Play()
end
if you move the imagelabel -1 back in scale specifically and not offset, it will be the same
If you want seamlessness, use this. First, make the offset size of the image label the exact size of the image in any axis you want the image to move. Judging from above, that would be x (1,imageSizeX,1,0). After, make the anchor point (1, 1). Then, make a tween starting from position (1, 0, 1, 0). If you have a tile size of, say, (400, 100), then make the tween ending position (1, 400, 1, 100). After that, just repeat it when it’s over and you should be good.
Edit: Just realised you’re using the other direction x. Just swap the to and from positions and it should work for that direction.