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

How do I make an imageGUI change image when I scroll over it?

Asked by 8 years ago

For example; I have this as an image gui http://www.roblox.com/SCROLLDOWN-item?id=265733519

when I scroll over it I want it to turn to this; http://www.roblox.com/scroll-down-select-item?id=265733452

Edit1; Yes, I mean scroll over it. The gui events page mean absolutely nothing to me, i've seen it but no idea what any of it means.

Edit2; Read http://wiki.roblox.com/index.php?title=API:Class/GuiObject/MouseEnter This still doesnt help me, I only know very very basic scripting, what would I do with that script? After GuiObject.MouseEnter:connect(function(x, y) what would I put?

0
Scroll over it? Meaning hover over it? AbsoluteAxiom 175 — 8y
0
Always do your research! If you took a look and a GUI's events on the wiki, there are a couple that suit just this purpose! Perci1 4988 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Dude, this is simple. To simple. First off, learn the proper asset ID's, not the URL's, and then learn how to use functions, as in

script.Parent.MouseEnter:connect(function()
--code here.
end)
0
believe me, the wiki is your friend. Use the cookbook especially, it explains a lot. rollercoaster57 65 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

This is what you should do:

script.Parent.MouseEnter:connect(function()
    script.Parent.Image = 'rbxassetid://265733452'
end)
script.Parent.MouseLeave:connect(function()
    script.Parent.Image = 'rbxassetid://265733519'
end)

Please note: This code is only tested with ImageLabels, but it should work. You just need to change "Image" to the name of the image property on the object.

0
Image property? As in the name as the decal or whatever the imagelabel is called? And what script would this be? Local script or just a normal one? Would the script go inside the imagelabel? idesoiate 0 — 8y
0
ImageLabels have a property called "Image" (Property Browser > [image label object] > Image > Image). The script would go inside of the imagelabel, and it can be a LocalScript. It goes inside the imagelabel so that way "script.Parent" returns the ImageLabel. CoderLeo 50 — 8y

Answer this question