undefined Posted April 14, 2014 Posted April 14, 2014 (edited) Hi guys. I will be a question. How to create image button? Edited April 14, 2014 by Guest
undefined Posted April 14, 2014 Author Posted April 14, 2014 What do I use for this? "onClientGuiClick"? And pointing to the picture, how do I change the transparency and how do change image when i clicked?
cheez3d Posted April 14, 2014 Posted April 14, 2014 guiCreateStaticImage() guiStaticImageLoadImage() "onClientMouseEnter" "onClientMouseLeave" "onClientGUIClick"
undefined Posted April 14, 2014 Author Posted April 14, 2014 local x,y = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() sWindow = guiCreateWindow((x/2)-100, (y/2)-75, 200, 150, "Deneme", false) guiWindowSetSizable(sWindow, false) guiSetVisible(sWindow, false) guiSetAlpha(sWindow, 0.65) egg_deneme = guiCreateStaticImage(88, 55, 25, 35, "images/egg.png", false, sWindow) close = guiCreateButton(30, 123, 139, 17, "Close", false, sWindow) end ) addEventHandler( "onClientMouseEnter", getRootElement(), function() guiStaticImageLoadImage(egg_deneme, "images/egg_sel.png" ) guiSetAlpha(egg_deneme, 0.65) end ) addEventHandler( "onClientMouseLeave", getRootElement(), function() guiStaticImageLoadImage(egg_deneme, "images/egg.png" ) guiSetAlpha(egg_deneme, 1.00) end ) function open() if (guiGetVisible (sWindow) == true) then guiSetVisible(sWindow, false) showCursor(false) elseif (guiGetVisible (sWindow) == false) then guiSetVisible(sWindow, true) showCursor(true) end end bindKey ("L", "down", open) function close() if source == close then guiSetVisible ( sWindow,false ) showCursor(false) end end addEventHandler("onClientGUIClick",root,close ) I've done it. The image is changing when I comes to the window but i want to changing when I comes to on the image. How to fix it?
Mega9 Posted April 14, 2014 Posted April 14, 2014 local x,y = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() sWindow = guiCreateWindow((x/2)-100, (y/2)-75, 200, 150, "Deneme", false) guiWindowSetSizable(sWindow, false) guiSetVisible(sWindow, false) guiSetAlpha(sWindow, 0.65) egg_deneme = guiCreateStaticImage(88, 55, 25, 35, "images/egg.png", false, sWindow) close = guiCreateButton(30, 123, 139, 17, "Close", false, sWindow) end ) addEventHandler( "onClientMouseEnter", getRootElement(), function() if source == egg_deneme then guiStaticImageLoadImage(egg_deneme, "images/egg_sel.png" ) guiSetAlpha(egg_deneme, 0.65) end end ) addEventHandler( "onClientMouseLeave", getRootElement(), function() if source == egg_deneme then guiStaticImageLoadImage(egg_deneme, "images/egg.png" ) guiSetAlpha(egg_deneme, 1.00) end end ) function open() if (guiGetVisible (sWindow) == true) then guiSetVisible(sWindow, false) showCursor(false) elseif (guiGetVisible (sWindow) == false) then guiSetVisible(sWindow, true) showCursor(true) end end bindKey ("L", "down", open) function close() if source == close then guiSetVisible ( sWindow,false ) showCursor(false) end end addEventHandler("onClientGUIClick",root,close )
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