kokoseda Posted April 19, 2020 Share Posted April 19, 2020 I want to make the grid list in center local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local Font = dxCreateFont("gfx/Roboto-Condensed.ttf", 13) ---<< Criando a fonte .. local Botao = "F4" --<<<<< Coloque o Botão que irá abrir o painel entre as "aspas".. --------- function PainelDc() dxDrawRectangle(761, 322, 399, 436, tocolor(254, 0, 0, 123), false) dxDrawRectangle(761, 322, 399, 40, tocolor(240, 157, 13, 123), false) dxDrawText("الانتقالات", 841, 325, 1073, 356, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) dxDrawRectangle(891, 700, 144, 43, tocolor(240, 157, 13, 123), false) dxDrawText("انتقال", 891, 700, 1035, 743, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) guiSetVisible(grid,false) grid = guiCreateGridList(804, 406, 317, 274, false) guiGridListAddColumn(grid, "1", 0.9) guiGridListAddRow(grid) guiGridListSetItemText(grid, 0, 1, "-", false, false) end --------------- Painelstt = false --<<<< Status do painel(PainelDc) function OpenPainel() --<<<<< Todo if significa == se for .. if Painelstt == false then --<<<< Verifica se o painel está fechado e logo após o abre e poe seu status como true(aberto) addEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = true showCursor(true) else --<<<< else(significa o contrario) se não for .. removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) end end bindKey(Botao, "down", OpenPainel)---<<<< Adicionando a Bind(tecla) que irá abrir o Painel! function isCursorOnElement( posX, posY, width, height ) --<< Funçao que verifica a posiçao do Cursor (mouse) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return false end Link to comment
#\_oskar_/# Posted April 20, 2020 Share Posted April 20, 2020 (edited) 14 hours ago, kokoseda said: local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) dxDrawRectangle(x*761, y*322, x*399, y*436,tocolor(254, 0, 0, 123), false) Edited April 20, 2020 by #\_oskar_/# 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