px,py = guiGetScreenSize()
function dxDrawProgressBar(BGW,BGH,PBW,PBH,BGcolor,PBcolor,progress)
if BGW > PBW and BGH > PBH then
local BGstartx, BGstarty, PBstartx, PBstarty, percent, executed;
if not executed then
executed = true
BGstartx = math.floor((px - BGW) / 2)
BGstarty = math.floor((py - BGH) / 2)
PBstartx = math.floor((px - PBW) / 2)
PBstarty = math.floor((px - PBH) / 2)
percent = math.floor(PBW / 100)
end
local drawprogress = math.floor(progress * percent)
dxDrawRectangle(BGstartx,BGstarty,BGW,BGH,BGcolor,true)
dxDrawRectangle(PBstartx,PBstarty,drawprogress,PBH,PBcolor,true)
end
end