Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-05-04, 18:58


PanGrzybulek







Wiek: 28
Na forum: 4823 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
Jak dopasowac to okno do kazdej rozdzielczosci?


GUIEditor = {
    gridlist = {},
    button = {},
    edit = {}
}

        GUIEditor.gridlist[1] = guiCreateGridList(241981101691false)
        guiSetAlpha(GUIEditor.gridlist[1], 0.79)
        GUIEditor.edit[1] = guiCreateEdit(10922931339""falseGUIEditor.gridlist[1])
        GUIEditor.edit[2] = guiCreateEdit(10942931339""falseGUIEditor.gridlist[1])
        GUIEditor.button[1] = guiCreateButton(3355546855"LOGUJ NA POSTA?"falseGUIEditor.gridlist[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.edit[3] = guiCreateEdit(64622931339""falseGUIEditor.gridlist[1])
        GUIEditor.edit[4] = guiCreateEdit(64642931339""falseGUIEditor.gridlist[1])
        GUIEditor.button[2] = guiCreateButton(59055546855"REJESTRUJ POSTA?"falseGUIEditor.gridlist[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA") 

    function draw()
        dxDrawLine(78798787788tocolor(255255255255), 1true)
        dxDrawText("Logowanie"340115773220tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Logowanie"340113773218tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Logowanie"338115771220tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Logowanie"338113771218tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Logowanie"339114772219tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("LOGIN :"436294702341tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("LOGIN :"436292702339tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("LOGIN :"434294700341tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("LOGIN :"434292700339tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("LOGIN :"435293701340tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."385375777396tocolor(255255255255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"437493703540tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"437491703538tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"435493701540tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"435491701538tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"436492702539tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."9323761324397tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."9323741324395tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."9303761322397tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."9303741322395tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Login jest inny ni? tw?j nick."9313751323396tocolor(255255255255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."8355781227599tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."8355761227597tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."8335781225599tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."8335761225597tocolor(000255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."8345771226598tocolor(255255255255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Rejestracja"8701141303219tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawLine(2811691315169tocolor(255255255255), 1true)
        dxDrawText("LOGIN :"9862931252340tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("haslo :"9704921236539tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie."292577684598tocolor(255255255255), 0.50"bankgothic""left""top"falsefalsetruefalsefalse)
    end

local localPlayer getLocalPlayer ( )

function otwieranieokna( )
    local playername getPlayerName(localPlayer)
    
    guiSetText(GUIEditor.edit[1], "")
    guiSetText(GUIEditor.edit[3], "")

    

    guiSetVisible (  GUIEditor.gridlist[1], true )
    addEventHandler("onClientRender"getRootElement(), draw)
    guiSetInputEnabled(true)
    showCursor true )
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), otwieranieokna )

function login buttonstate )
    if (source == GUIEditor.button[1]) then
    local login guiGetText(GUIEditor.edit[1])
    local haslo guiGetText(GUIEditor.edit[2])
        triggerServerEvent "onLogin"getRootElement(), localPlayerloginhaslo)
    end
end
addEventHandler "onClientGUIClick"GUIEditor.button[1], loginfalse )

function Register buttonstate )
    if (source == GUIEditor.button[2]) then
    local login guiGetText(GUIEditor.edit[3])
    local haslo guiGetText(GUIEditor.edit[4])
        triggerServerEvent "onRegister"getRootElement(), localPlayerloginhaslo)
    end
end
addEventHandler "onClientGUIClick"GUIEditor.button[2], Registerfalse )


function zamykanieokna()
removeEventHandler("onClientRender"getRootElement(), draw)
    guiSetInputEnabled(false)
    guiSetVisible GUIEditor.gridlist[1], false )
    showCursor false )
end
addEvent"zamykanieokna"true )
addEventHandler"zamykanieokna"getRootElement(), zamykanieokna )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-04, 20:33


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5199 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

Co do dx draw?w:

function dxDrawRelativeTexttext,posX,posY,right,bottom,color,scale,mixed_font,alignX,alignY,clip,wordBreak,postGUIcolorCoded )
    local resolutionX 1024 -- twoja rozdzielczosc
    local resolutionY 768
    local sWidth,sHeight guiGetScreenSize( )
    return dxDrawText(
        tostringtext ),
        ( posX/resolutionX )*sWidth,
        ( posY/resolutionY )*sHeight,
        ( right/resolutionX )*sWidth,
        ( bottom/resolutionY)*sHeight,
        color,( sWidth/resolutionX )*scale,
        mixed_font,
        alignX,
        alignY,
        clip,
        wordBreak,
        postGUI,
        colorCoded
    )
end

function dxDrawRelativeLine(startXstartYendXendYcolorwidthpostGUI)
    local resolutionX 1024 -- twoja rozdzielczosc
    local resolutionY 768
    local sWidthsHeight guiGetScreenSize( )
    return dxDrawLine(
        (startX/resolutionX)*sWidth,
        (startY/resolutionY)*sWidth,
        (endX/resolutionX)*sWidth,
        (endY/resolutionY)*sHeight,
        color,
        width,
        postGUI
    )
end

Podmie? nazwy funkcji dx na te co poda?em. I zmie? rozdzielczo?? na twoj? ;) . Co do GUI.. u?yj opcji Szukaj.

Postaw piwo autorowi tego posta
 

 
Tagi: guigetscreensize
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku