@Dealman, so i need put this on my code ?
@KRZO This is my code for tests.
Using normal MTA GUI:
function createMenuGUI()
local xw, xh = guiGetScreenSize()
local Width, Height = 473,284
local X = (xw/2) - (Width/2)
local Y = (xh/2) - (Height/2)
window_test = guiCreateWindow(X, Y, Width, Height, "Test", false)
btn_test = guiCreateButton(155, 135, 200, 30, "Test Button", false, window_test)
end
function openGUI()
createMenuGUI()
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), openGUI)
Result:
http://i.imgur.com/111RHhz.png
Using dxGUI:
function createMenuGUI()
local xw, xh = guiGetScreenSize()
local Width, Height = 473,284
local X = (xw/2) - (Width/2)
local Y = (xh/2) - (Height/2)
window_test = exports.dxgui_v1:dxCreateWindow(X, Y, Width, Height, "Test", tocolor(255, 255, 255, 255), "Lighter Black")
btn_test = exports.dxgui_v1:dxCreateButton(140, 135, 200, 30, "Test Button", tocolor(255,0,0,255), "default-bold", "Orange", window_test)
end
function openGUI()
createMenuGUI()
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), openGUI)
Result (nothing):
http://i.imgur.com/vH3K4Mq.png