function isMouseInPosition ( x, y, width, height ) -- Função útil. Serve pra verificar se o mouse está dentro de determinada área ou não.
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
end
addEventHandler ("onClientRender", root, function ()
dxDrawImage (x*400, y*100, x*233, y*214, "teste.png", 0, 0, 0, (isMouseInPosition (x*400, y*100, x*233, y*214) and tocolor (255, 255, 255, 240) or tocolor (255, 255, 255, 100)))
end) -- O alpha do botão ficará em 240 quando o mouse estiver em cima da imagem e 100 quando não estiver.