Jump to content

Changing DX Image on Cursor Move


Karuzo

Recommended Posts

Posted

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

Posted

You can compare the cursor position to the image position, there are no events for DX.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ?

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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