Jump to content

onClientMouseEnter : bad triggering


_Kinan

Recommended Posts

Posted

Hi, I added an event handler to my static image. but when I actually 
 

See the gif
5OFDYkJ.gif

code : 


login = {
    label = {},
    staticimage = {},
    edit = {}
}
login.staticimage[1] = guiCreateStaticImage(557, 336, 400, 404, "imgs/window.png", false)

login.staticimage[2] = guiCreateStaticImage(191, 314, 185, 57, "imgs/register.png", false, login.staticimage[1])
login.staticimage[3] = guiCreateStaticImage(14, 308, 167, 73, "imgs/login.png", false, login.staticimage[1])

---- EVENT : 
addEventHandler("onClientMouseEnter",login.staticimage[2],function()
	guiSetAlpha(login.staticimage[2],0.8)
		outputChatBox("trigger in")

end)
addEventHandler("onClientMouseLeave",login.staticimage[2],function()
	guiSetAlpha(login.staticimage[2],0.2)
	outputChatBox("trigger left")
end)
guiSetAlpha(login.staticimage[2],0.2)

 

  • Moderators
Posted

https://wiki.multitheftauto.com/wiki/AddEventHandler

Optional Arguments

    getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this).

Posted

i recommend you using dx fully for really almost every ui, it just runs so much faster than an actual gui. Maybe it's a bit slower to make if u do it without any libs, but it's definetly worth it if you know how to style with it.

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