Sziasztok. Elkezdtem csinálni egy hudot, a Rectangle-ek nem csúsznak el rajta ( ebben segített az mta wiki
), viszont a dxDrawImage ikonok sajnos elcsúsznak. Próbáltam már dolgokat, de nem tudtam még rájönni, hogy hogyan tudnám azt is megcsinálni, hogy ne csússzon el. Válaszotokat előre is köszönöm!
local playerHP = math.floor(getElementHealth(localPlayer))
local playerArmour = math.floor(getPedArmor(localPlayer))
local playerMoney = getPlayerMoney()
local playerPing = getPlayerPing(getLocalPlayer())
dxDrawImage ( screenWidth/2 - -340, 58, 45, 45, \'rgm.png\')
dxDrawRectangle ( x/1.35, y/45, x/4, y/30, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.35, y/4.60, x/6, y/30, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.35, y/15, x/4, y/7, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.23, y/13, x/6, y/33, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.23, y/13, playerHP*2.28, y/33, tocolor ( 38, 166, 91, 150 ) )
dxDrawRectangle ( x/1.23, y/8.50, x/6, y/33, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.23, y/8.50, playerArmour*2.28, y/33, tocolor ( 255, 255, 255, 255 ) )
dxDrawImage ( screenWidth/2 - -340, 14, 110, 30, \'logo.png\')
dxDrawImage ( screenWidth/2 - -350, 170, 16, 16, \'coin.png\')
dxDrawImage ( screenWidth/2 - -400, 58, 25, 25, \'heal.png\')
dxDrawImage ( screenWidth/2 - -400, 88, 25, 25, \'armor.png\')
dxDrawText (playerHP.. \'%\', x/1.13, y/12.5, x, y, tocolor ( 255, 255, 255, 255 ), 1, \"default-bold\" )
dxDrawText (playerArmour.. \'%\', x/1.13, y/8.25, x, y, tocolor ( 255, 255, 255, 255 ), 1, \"default-bold\" )
dxDrawText (playerName, x/1.14, y/37, x, y, tocolor ( 255, 255, 255, 255 ), 1.3, \"default-bold\" )
dxDrawText (playerMoney .. \' $\', x/1.29, y/4.60, x, y, tocolor ( 255, 255, 255, 255 ), 1, \"diploma\" )
dxDrawText (\'ping:\'..playerPing, x/1.06, y/4.80, x, y, tocolor ( 38, 166, 91, 150 ), 2, \"sand\" )
local playerVehicle = getPedOccupiedVehicle ( localPlayer )
if playerVehicle then
local vehicleHealth = getElementHealth ( playerVehicle ) / 10 -- Divide this by 10, as default the denominator is 1000
dxDrawRectangle ( x/1.41, y/45, x/45, y/5.30, tocolor ( 0, 0, 0, 150 ) )
dxDrawRectangle ( x/1.41, y/45, x/45, vehicleHealth*1.45, tocolor ( 162, 162, 162, 162 ) )
end