_Kinan Posted December 17, 2017 Share Posted December 17, 2017 Hi, I added an event handler to my static image. but when I actually See the 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) Link to comment
Moderators IIYAMA Posted December 17, 2017 Moderators Share Posted December 17, 2017 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). Link to comment
Fist Posted December 17, 2017 Share Posted December 17, 2017 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. 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