A little example
local sx, sy = guiGetScreenSize();
local scaleX,scaleY = 1920/sx, 1080/sy; -- replace 1920 and 1080 with your resolution!
function draw()
-- Let's say we want to create a button on the right side 20px away from the screen at 150px from the bottom;
local xpos = 20*scaleX;
local ypos = 150*scaleY;
local text = "PRESS ME!";
local tx, ty = dxGetTextSize(text, 0, 1, 1, Roboto, true);
dxDrawText(text, sx-tx-xpos, sy-ty-ypos, sx-xpos, sy-ypos, tocolor(255,255,255,255), 1, Roboto, "center", "center", false, false, false, true);
end
addEventHandler("onClientRender", root, draw);
Take a look at this tutorial:
Hope that helped you!