Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to make a ImageLabel Animation?

Asked by 9 years ago

Hello Im trying to make a ImageLabel Animation And I dont know why this doesnt work Please Help!

script.Parent.Image = 'rbxassetid://188837344'

1 answer

Log in to vote
0
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

I believe the only reason why the animation doesn't work is because that's not an animation. That's just a statement setting the Image to that ID.

What type of animation do you want to do? Frame animation, or GUI Tweening?

Frame Animation:

The image "moves" with closely-related images displayed in a sequence.

Example 1: Click to animate

sp = script.Parent

function Animate()
sp.Image = "rbxassetid://60832050"
wait(.1)
sp.Image = "rbxassetid://60832071"
wait(.1)
sp.Image = "rbxassetid://60832077"
wait(.1)
sp.Image = "rbxassetid://60832081"
wait(.1)
sp.Image = "rbxassetid://60832083"
wait(.1)
sp.Image = "rbxassetid://60832090"
wait(.1)
sp.Image = "rbxassetid://60832094"
wait(.1)
sp.Image = "rbxassetid://60832099"
wait(.1)
sp.Image = "rbxassetid://60832106"
wait(.1)
sp.Image = "rbxassetid://60832113"
-- etcetera
end

script.Parent.TextButton.MouseButton1Click:connect(Animate)

Example 2: Continuously animate like a GIF

sp = script.Parent

while true do
sp.Image = "rbxassetid://60832050"
wait(.1)
sp.Image = "rbxassetid://60832071"
wait(.1)
sp.Image = "rbxassetid://60832077"
wait(.1)
sp.Image = "rbxassetid://60832081"
wait(.1)
sp.Image = "rbxassetid://60832083"
wait(.1)
sp.Image = "rbxassetid://60832090"
wait(.1)
sp.Image = "rbxassetid://60832094"
wait(.1)
sp.Image = "rbxassetid://60832099"
wait(.1)
sp.Image = "rbxassetid://60832106"
wait(.1)
sp.Image = "rbxassetid://60832113"
wait(.1)
-- etcetera
end

Tweening:

The animation (moving or resizing) of a frame or any other GUI object elements that can be displayed on the screen.

Example:

script.Parent.Frame:TweenPosition(UDim2.new(1,0,1,0), "Out", "Quad", .5, true)

Formula:

[GUI Object]:[TweenType](UDim2.new([X Scale], [X Offset], [Y Scale], [Y Offset]), "[EasingDirection]", "[EasingStyle]", [Time], [AbleToOverride])

0
You can also use a 'spritemap' image and set the ImageRectOffset in the script. Tkdriverx 514 — 9y
Ad

Answer this question