Witam..
1 raz tworz? GUI z grafik?, wi?c prosz? o wyrozumia?o??...
Wi?c mam sobie GUI, jak najad? na pozycje [b](screenW * 0.76, screenH * 0.125, screenW * 0.220, screenH * 0.6)[/b] i klikn? w przycisk, kt?ry jest na tej pozycji to [u][b]GUI powinno znikn??[/b][/u], lecz problem jest w tym, ?e jak klikn? poza GUI to i tak GUI si? zamyka..
c-side
[lua]local sx, sy = guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
function gui()
dxDrawImage(screenW * 0.75 --[[prawo, lewo]], screenH * 0.3 --[[g?ra, d??]], screenW * 0.25 , screenH * 0.7, "Panel/Panel.png", 0, 0, 0, tocolor(255, 255, 255), false)
dxDrawImage(screenW * 0.76, screenH * 0.125, screenW * 0.220, screenH * 0.6, "Panel/1.png", 0, 0, 0, tocolor(255, 255, 255), false)
dxDrawImage(screenW * 0.76, screenH * 0.185, screenW * 0.220, screenH * 0.6, "Panel/2.png", 0, 0, 0, tocolor(255, 255, 255), false)
end
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if isMouseIn(screenW * 0.76, screenH * 0.125, screenW * 0.220, screenH * 0.6) then
showCursor(false)
remov... |