Jump to content

Changing DX Image on Cursor Move


Karuzo

Recommended Posts

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 :)

Link to comment

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 ?

Link to comment
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.

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