Wysłany: 2018-01-23, 23:55
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
Witam..
1 raz tworz? GUI z grafik?, wi?c prosz? o wyrozumia?o??...
Wi?c mam sobie GUI, jak najad? na pozycje (screenW * 0.76, screenH * 0.125, screenW * 0.220, screenH * 0.6) i klikn? w przycisk, kt?ry jest na tej pozycji to GUI powinno znikn?? , lecz problem jest w tym, ?e jak klikn? poza GUI to i tak GUI si? zamyka..
c-side
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 )
removeEventHandler ( "onClientRender" , root , gui )
end
end
end )
local Marker = createMarker ( 2482.89380 , - 1664.70251 , 13.34375 , "cylinder" , 1 , 0 , 0 , 0 , 255 )
addEventHandler ( "onClientMarkerHit" , Marker , function( el )
if el ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , gui )
showCursor ( true , false )
end )
Wysłany: 2018-01-24, 00:12
.RiV
Wiek: 25 Na forum: 3588 dni Posty: 554
Nick w MP: Split
Piwa : 2596
Jakie? b??dy w debugscript ? (komenda /debugscript 3)
Podpis
Autor OGRPG, na scenie MTA od 2012 roku.
Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018
Wysłany: 2018-01-24, 00:13
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
Nie, ?adnych b??d?w nie ma
[ Dodano : 2018-01-24, 00:26 ]
eh... problem rozwi?zany..... zbyt du?e pole, na kt?rym jest grafika
mo?na LOCK
Tagi: problem :: quotifmouseinquot
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: