Karuzo Posted February 13, 2014 Posted February 13, 2014 Hey Guys, so i have a login panel, and i want to change the login_btn.png ( the normal login button picture ) to login_h.png( the hover'd login button picture) if the player moves with over the login button.. But i just don't know how i could make this. Hope you can help me
Castillo Posted February 13, 2014 Posted February 13, 2014 There are two events for when the cursor enters/leaves a GUI element. onClientMouseEnter onClientMouseLeave
Karuzo Posted February 13, 2014 Author Posted February 13, 2014 Well, i don't want to use GUI elements, is there a similiar event for DX elements ?
Castillo Posted February 13, 2014 Posted February 13, 2014 You can compare the cursor position to the image position, there are no events for DX.
Karuzo Posted February 13, 2014 Author Posted February 13, 2014 Ok, so i tried it with GUICreateStaticImage, 'cause it is easier, but my problem is it doesn't change... Code : Loginbtn = guiCreateStaticImage(X+5, Y+300, 290, 65, "images/login_btn.png", false) guiSetVisible(Loginbtn, false) addEventHandler("onClientMouseEnter",Loginbtn,LoginH) function LoginH () guiStaticImageLoadImage(Loginbtn, "images/login_h.png" ) end It's automatically login_h.png why ?
Castillo Posted February 13, 2014 Posted February 13, 2014 addEventHandler("onClientMouseEnter",Loginbtn,LoginH) Put it like this: addEventHandler ( "onClientMouseEnter", Loginbtn, LoginH, false ) that "false" at the end is the "getPropagated" argument, if you don't put it as false, it'll execute the function once you move the cursor over any GUI element.
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