GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Segítségkérés => A témát indította: xerox0224 - 2017. Január 21. - 19:24:03

Cím: GUI Felület
Írta: xerox0224 - 2017. Január 21. - 19:24:03
Sziasztok! 
 
Nemrég kezdtem a LUA-t. Guieditor-ral GUI felületet akarok készíteni. Ha megvan a GUI, akkor innentől hogyan tovább? Mármint a label-ekre hogyan tudok tenni valamit, mint pl. outputChatBox-ot?
 


addEventHandler(\"onClientResourceStart\", resourceRoot,
    function teszt()
        gomb1 = guiCreateLabel(586, 229, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[9], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[9], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[9], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[9], \"center\")

        gomb2 = guiCreateLabel(586, 271, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[10], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[10], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[10], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[10], \"center\")

        gomb3 = guiCreateLabel(587, 313, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[11], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[11], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[11], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[11], \"center\")

        gomb4 = guiCreateLabel(587, 355, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[12], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[12], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[12], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[12], \"center\")

        gomb5 = guiCreateLabel(586, 397, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[13], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[13], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[13], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[13], \"center\")

        gomb6 = guiCreateLabel(586, 439, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[14], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[14], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[14], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[14], \"center\")

        gomb7 = guiCreateLabel(586, 481, 239, 33, \"AK-47\", false)
        guiSetFont(GUIEditor.label[15], \"default-bold-small\")
        guiLabelSetColor(GUIEditor.label[15], 0, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[15], \"center\", false)
        guiLabelSetVerticalAlign(GUIEditor.label[15], \"center\")    
    end
)
addEventHandler(\"onClientRender\", root,
    function teszt1()
        dxDrawLine(577 - 1, 220 - 1, 577 - 1, 551, tocolor(255, 255, 255, 254), 1, false)
        dxDrawLine(835, 220 - 1, 577 - 1, 220 - 1, tocolor(255, 255, 255, 254), 1, false)
        dxDrawLine(577 - 1, 551, 835, 551, tocolor(255, 255, 255, 254), 1, false)
        dxDrawLine(835, 551, 835, 220 - 1, tocolor(255, 255, 255, 254), 1, false)
        dxDrawRectangle(577, 220, 258, 331, tocolor(0, 0, 0, 148), false)
        dxDrawRectangle(587, 230, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 272, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 314, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 356, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 398, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 440, 238, 32, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(587, 482, 238, 32, tocolor(255, 255, 255, 255), false)
    end
)
Cím: GUI Felület
Írta: BlackSy - 2017. Január 21. - 22:02:07
Biztos label lenne a gomb?
Cím: GUI Felület
Írta: Robika1 - 2017. Január 22. - 13:15:08
Általában a gombokat használják olyan GUI elemként, amire kattintani szoktak. Labelre is lehet, de akkor már DX-szel csináld, mert ugyanaz, de sokkal szebb dolgokat lehet belőle csinálni, meg több lehetőséged van a formázásra. Amit keresel, szerintem ez a funkció lesz: OnClientGUIClick (ezzel tudsz a labelre outputChatBoxot tenni). Az oldalon van is egy remek kis példa. Ha majd szeretnél DX gombos cuccokat csinálni, akkor a fórumon keress rá a dobozbaVan-ra
 
Robika1
Cím: GUI Felület
Írta: BlackSy - 2017. Január 22. - 15:54:37
Lehet label-re kattintani? :D nem igazán szeretem a gui-t szóval nem tudtam. :D
Cím: GUI Felület
Írta: thegergo02 - 2017. Január 22. - 17:21:54
Bármire lehet kattintani, akár ablakra is jó az OnClientGUIClick