Jump to content

About MTASA image button?


Recommended Posts

Posted

ok im ok.

button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) 
 missionimage =guiCreateStaticImage(0, 0.05, 1, 0.9,"images/palette.png", true,button)   
 guiSetAlpha ( missionimage, 0.5) 
 guiSetEnabled ( missionimage, false ) 

Posted

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.

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...