Hello. I created a test hud and i added a button using dgs. The problem is, when i add that button, the script doesn't show nothing. If i delete all the lines where i use this language, the hud is showing normally. I'm new in this language and i don't know exactly how to use another languages than the default. I used a hud downloaded from resources section as an example.
Code:
loadstring(exports.dgs:dgsImportFunction())()
loadstring(exports.dgs:dgsImportOOPClass(true))()
local screensize = Vector2(guiGetScreenSize())
local buttonsize = Vector2(100, 50)
local windowsize = Vector2(400, 400)
local windowfinal = Vector2(screensize.x/2 - windowsize.x/2, screensize.y/2 - windowsize.y/2)
local buttonfinal = Vector2(screensize.x/2 - buttonsize.x/2, screensize.y/2 - buttonsize.y/2)
function paneltest()
dxDrawImage(windowfinal.x, windowfinal.y, windowsize.x, windowsize.y, 'panels/window.png', 0, 0, 0, tocolor(255, 255, 255, 150), false)
dxDrawImage(windowfinal.x, windowfinal.y, windowsize.x, windowsize.y, 'panels/window2.png')
dgsCreateButton(buttonfinal.x, buttonfinal.y, buttonsize.x, buttonsize.y, "Test", true)
dxDrawText("JobInfo", windowfinal.x+180, windowfinal.y)
end
addEventHandler("onClientRender", root,
function()
paneltest()
end
)
meta.xml:
<meta>
<info author="matei123" type="script" version="1.0.0" />
<script src="code.lua" type="server" />
<script src="gui.lua" type="client" />
<file src='panels/window.png' />
<file src='panels/window2.png' />
</meta>