Jump to content

Hello


kokoseda

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...