crazyde21 Posted March 5, 2014 Posted March 5, 2014 I want to use the Picture button in the GUI inside, if I move the mouse to brighten the picture then the picture, click can triggerEvent
WhoAmI Posted March 5, 2014 Posted March 5, 2014 onClientMouseEnter onClientMouseLeave onClientGUIClick guiCreateStaticImage
Dealman Posted March 5, 2014 Posted March 5, 2014 You'll also want to use guiStaticImageLoadImage to change the image upon mouse hover. Instead of creating a new image.
crazyde21 Posted March 6, 2014 Author Posted March 6, 2014 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 )
Dealman Posted March 6, 2014 Posted March 6, 2014 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now