Submitter Posted July 5, 2016 Share Posted July 5, 2016 I need help with something, when i click a static image, It will be changed to another static image, and If i click another one, the normal static Image will return, anyhelp? Link to comment
Bean666 Posted July 5, 2016 Share Posted July 5, 2016 hmm, maybe make a big button that has the same size with the image. and set the alpha of the button to 0. Link to comment
Submitter Posted July 5, 2016 Author Share Posted July 5, 2016 I can't understand.. can u make a code/ Link to comment
Captain Cody Posted July 5, 2016 Share Posted July 5, 2016 https://wiki.multitheftauto.com/wiki/GuiCreateButton https://wiki.multitheftauto.com/wiki/Gu ... taticImage Match up X,Y, Width, Height. local x,y , width, height = 0,0,0,0 -- CHANGE function button () local button = guiCreateButton ( x,y , width, height,"", false, menu) guiSetAlpha (button ,0) addEventHandler ( "onClientGUIClick", button , setImage, false ) end path = {"Path1","Path2","Path3"} function setImage () destroyElement(static) if patha > (#path-1) then patha = 0 else patha = patha+1 end static = guiCreateStaticImage (x,y , width, height,path[patha], false,menu) end Questions? Link to comment
Submitter Posted July 5, 2016 Author Share Posted July 5, 2016 But If I have clicked another one It will be changed to old one? Link to comment
Captain Cody Posted July 5, 2016 Share Posted July 5, 2016 This will cycle through pictures you define in the path= table Example path = {"me.png","car.png","Oldmandowntheroad.png"} Link to comment
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