Hey guys! I have problem with a script which shows the real time. So i made it with dxDrawText. So i setted the position (my resolution 1920x1080). The problem is that my friend see it misplaced (he uses 1440x900). My question is how can i make it for all resolutions (including the widescreens) .
Here is my code:
function time()
local sx,sy = guiGetScreenSize()
local mix, miy = 1366, 768
local hours = getRealTime().hour
local minutes = getRealTime().minute
dxDrawText(string.format("%02d:%02d", hours, minutes), (101.7/mix)*sx, (540.7/miy)*sy, (1299/mix)*sx, (56/miy)*sy ,tocolor(0,0,0,255),0.7,"bankgothic","left","top",false,false,false)
dxDrawText(string.format("%02d:%02d", hours, minutes), (101/mix)*sx, (540/miy)*sy, (1299/mix)*sx, (56/miy)*sy ,tocolor(69,103,137,255),0.7,"bankgothic","left","top",false,false,false)
if (minutes < 10) then m = "0"..minutes end
end
addEventHandler ( "onClientRender", getRootElement(), time )