I am building a map and need to make a scrolling sign for a shop. Basically, if you don’t know what a scrolling sign is, it’s one of those LED signs you see at barber shops/small stores with text moving in and out of it. If you still don’t know what I mean, a quick search of it will show up an idea of what I need. All help is appreciated, thank you! (P.S, the scrolling sign will be on a part!)
If you get a part and use surfaceUI, then use a frame with the text and the design then simply use a tween to slowly move it across. To stop the frame going outide of the part which it shouldnt do anyway i dont think simply enable clipped decendants.
Create a SurfaceGui, with ClipDescendants enabled and make a textlabel with the appropriate Y sizing, and the X sizing being something large (such as 3,0) depending the text (Also look in to GetTextBoundsAsync)
Set your text and customize! Make sure it fills a majority of the space.
Now its time to program it! Refer to the example script below (however yours might look different)
local TweenService = game:GetService("TweenService")
local Gui = path.to.SurfaceGui
local Label1 = Gui.Label
local Label2 = Gui.Label:Clone(); Label2.Parent = Label1.Parent; Label2.Position = UDim2.fromScale(Label1.Size.X.Scale, Label2.Position.Y.Scale) --For padding, scale the TextSize down instead!
local TimeToScroll = 10 --how long between scrolls
--We use Linear EasingStyle because it creates that seamless, infinite scrolling effect
local Tween1 = TweenService:Create(Label1, TweenInfo.new(TimeToScroll, Enum.EasingStyle.Linear), {
Position = UDim2.fromScale(-Label1.Size.X.Scale, Label1.Position.Y.Scale)
})
local Tween2 = TweenService:Create(Label2, TweenInfo.new(TimeToScroll, Enum.EasingStyle.Linear), {
Position = UDim2.fromScale(-Label2.Size.X.Scale, Label2.Position.Y.Scale)
})
local Label1Pos = Label1.Position
local Label2Pos = Label2.Position
Tween1:Play()
Tween1.Completed:Connect(function()
Label1.Position = Label2Pos
Tween2:Play()
end)
Tween2:Play()
Tween2.Completed:Connect(function()
Label2.Position = Label1Pos
Tween1:Play()
end)
Some things to note:
I wrote this on the devforum, so expect typos and bugs. it is all untested, but hopefully gives you an idea on everything
The reason I am using 2 labels is because i want it to show the text directly after the original text is ending, so that it seems like infinitely repeating. If you only want to show the text again after the first label is completely out of sight, just use one label and one tween and run it in a loop (with proper delays)
I have a bit of a problem. The place I want the scrolling sign to be has edges but the text label only covers one. Here’s what I mean: How do I fix it?
Also, nothings printing. The Tween plays, but never ends?
local TweenService = game:GetService("TweenService")
local Gui = script.Parent.SurfaceGui
local Label1 = Gui.Label
local Label2 = Gui.Label:Clone(); Label2.Parent = Label1.Parent; Label2.Position = UDim2.fromScale(Label1.Size.X.Scale, Label2.Position.Y.Scale) --For padding, scale the TextSize down instead!
local TimeToScroll = 10 --how long between scrolls
--We use Linear EasingStyle because it creates that seamless, infinite scrolling effect
local Tween1 = TweenService:Create(Label1, TweenInfo.new(TimeToScroll, Enum.EasingStyle.Linear), {
Position = UDim2.fromScale(-Label1.Size.X.Scale, Label1.Position.Y.Scale)
})
local Tween2 = TweenService:Create(Label2, TweenInfo.new(TimeToScroll, Enum.EasingStyle.Linear), {
Position = UDim2.fromScale(-Label2.Size.X.Scale, Label2.Position.Y.Scale)
})
local Label1Pos = Label1.Position
local Label2Pos = Label2.Position
Tween1:Play()
Tween1.Completed:Connect(function()
Label1.Position = Label2Pos
print("2")
Tween2:Play()
end)
Tween2:Play()
Tween2.Completed:Connect(function()
Label2.Position = Label1Pos
print("1")
Tween1:Play()
end)