Basically i want to make an imagelabel GUI that is scrolling.
How do i do this using scripts?
there isnt any possible way to “spawn” a imagelabel scroll but you can make a scrollingframe and also a imagelabel in the same position and just make the transparency of the scrollingframe to 1 like this:
local GUI = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local scrollingframe = Instance.new("ScrollingFrame", GUI)
local imagelabel = Instance.new("ImageLabel", GUI)
scrollingframe.Position = UDim2.new(0.365, 0,0.363, 0)
imagelabel.Position = UDim2.new(0.365, 0,0.363, 0)
scrollingframe.Size = UDim2.new(0, 460,0, 250)
imagelabel.Size = UDim2.new(0, 460,0, 250)
scrollingframe.BackgroundTransparency = 1
imagelabel.BackgroundTransparency = 1
imagelabel.ZIndex = 0
scrollingframe.ZIndex = 1
and you can also simply change the image by doing this:
imagelabel.ImageId = "rbxassetid://imageidhere"
sorry if i were too uninformative with the issue, what im trying to do is make the image scroll automatically.
so is it possible to make the GUI scroll automactically usuing these scrollingframes?
with scrollingframes you can scroll by holding your left mouse button or using the mouse button 3 which is between left and right mouse button but im not so sure if its possible
if you meant anything else can you maybe show me a video of how it looks like?
it should look like the background here, sorry if its hard to see.
i want it to be similiar to this but only vertically.
I wish I saw this post earlier. I wanted to try this myself and found a solution! Maybe if you’re here you can try it, but here’s a video I made explaining how to do this!
Sorry for being a year late!
so if anyone in the future is looking at this and wants this to be vertical, go to line 37 and onwards in the script, replace it with this:
local offset = 0
RunService.RenderStepped:Connect(function(deltaTime)
if container.Visible then
offset = (offset + scrollSpeed) % tileWidth
texture.Position = UDim2.new(0.5, 0, 0.5, -offset)
end
end)
and if you want the other direction, remove the negative sign in offset.
If you still want it sideways but scrolling the other direction, also just remove the negative sign:
texture.Position = UDim2.new(0.5, offset, 0.5, 0)
hope this helps for future ppl!