Jump to content

About MTASA image button?


Recommended Posts

Now I'm confused as to what you want. You want that when the mouse hovers over an icon, it'll change the picture to a highlighted state? And do you want it to be clickable or what?

Then you could make something like this;

local imageHighlighted = false 
  
function onMouseHover_Handler() 
    if(source == missionimage) then 
        if(imageHighlighted == false) then 
            guiStaticImageLoadImage(missionimage, "YourHighlightImage.png") 
            imageHighlighted = true 
        elseif(imageHighlighted == true) then 
            guiStaticImageLoadImage(missionimage, "YourDefaultImage.png") 
            imageHighlighted = false 
        end 
    end 
    if((source ~= missionimage) and (imageHighlighted == true)) then 
        guiStaticImageLoadImage(missionimage, "YourDefaultImage.png") 
        imageHighlighted = false 
    end 
end 
addEventHandler("onClientMouseEnter", getRootElement(), onMouseHover_Handler) 

Do note however, that I have not tested it. So it may not behave as I think it would. It's very possible that it might flicker like crazy if hovering above it.

There are quite a few ways you could do this.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...