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: 29
Na forum: 4964 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(241, 98, 1101, 691, false)
        guiSetAlpha(GUIEditor.gridlist[1], 0.79)
        GUIEditor.edit[1] = guiCreateEdit(109, 229, 313, 39, "", false, GUIEditor.gridlist[1])
        GUIEditor.edit[2] = guiCreateEdit(109, 429, 313, 39, "", false, GUIEditor.gridlist[1])
        GUIEditor.button[1] = guiCreateButton(33, 555, 468, 55, "LOGUJ NA POSTA?", false, GUIEditor.gridlist[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.edit[3] = guiCreateEdit(646, 229, 313, 39, "", false, GUIEditor.gridlist[1])
        GUIEditor.edit[4] = guiCreateEdit(646, 429, 313, 39, "", false, GUIEditor.gridlist[1])
        GUIEditor.button[2] = guiCreateButton(590, 555, 468, 55, "REJESTRUJ POSTA?", false, GUIEditor.gridlist[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 

    function draw()
        dxDrawLine(787, 98, 787, 788, tocolor(255, 255, 255, 255), 1, true)
        dxDrawText("Logowanie", 340, 115, 773, 220, tocolor(0, 0, 0, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Logowanie", 340, 113, 773, 218, tocolor(0, 0, 0, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Logowanie", 338, 115, 771, 220, tocolor(0, 0, 0, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Logowanie", 338, 113, 771, 218, tocolor(0, 0, 0, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Logowanie", 339, 114, 772, 219, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("LOGIN :", 436, 294, 702, 341, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("LOGIN :", 436, 292, 702, 339, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("LOGIN :", 434, 294, 700, 341, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("LOGIN :", 434, 292, 700, 339, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("LOGIN :", 435, 293, 701, 340, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 385, 375, 777, 396, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 437, 493, 703, 540, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 437, 491, 703, 538, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 435, 493, 701, 540, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 435, 491, 701, 538, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 436, 492, 702, 539, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 932, 376, 1324, 397, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 932, 374, 1324, 395, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 930, 376, 1322, 397, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 930, 374, 1322, 395, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Login jest inny ni? tw?j nick.", 931, 375, 1323, 396, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 835, 578, 1227, 599, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 835, 576, 1227, 597, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 833, 578, 1225, 599, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 833, 576, 1225, 597, tocolor(0, 0, 0, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 834, 577, 1226, 598, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Rejestracja", 870, 114, 1303, 219, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawLine(281, 169, 1315, 169, tocolor(255, 255, 255, 255), 1, true)
        dxDrawText("LOGIN :", 986, 293, 1252, 340, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("haslo :", 970, 492, 1236, 539, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Najlepiej je?li haslo zostanie tylko w twojej g?owie.", 292, 577, 684, 598, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
    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 ( button, state )
    if (source == GUIEditor.button[1]) then
    local login = guiGetText(GUIEditor.edit[1])
    local haslo = guiGetText(GUIEditor.edit[2])
        triggerServerEvent ( "onLogin", getRootElement(), localPlayer, login, haslo)
    end
end
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], login, false )

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


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: 28
Na forum: 5340 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

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

Co do dx draw?w:

function dxDrawRelativeText( text,posX,posY,right,bottom,color,scale,mixed_font,alignX,alignY,clip,wordBreak,postGUI, colorCoded )
    local resolutionX = 1024 -- twoja rozdzielczosc
    local resolutionY = 768
    local sWidth,sHeight = guiGetScreenSize( )
    return dxDrawText(
        tostring( text ),
        ( 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(startX, startY, endX, endY, color, width, postGUI)
    local resolutionX = 1024 -- twoja rozdzielczosc
    local resolutionY = 768
    local sWidth, sHeight = 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 » guiGetScreenSize 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