So, I'm drawing a text on the world, using getScreenFromWorldPosition and getDistanceBetweenPoints3D.
Everything works perfect, but there's a little detail:
if dist <= 80 then
local x, y = getScreenFromWorldPosition(pick.posX, pick.posY, pick.posZ, 0.06)
local alpha = 255 - (dist * 3.15)
local scale = 1 / (0.7 * (dist / 150))
if x and y then
dxDrawText(getVehicleNameFromModel(pick.vehicle), x, y, x, y, tocolor(255, 255, 255, alpha), scale, "bankgothic", "center")
end
end
If I go away, text just get's smaller and it doesn't have a 'relative' value according to the distance.
Help would be appreciated, thanks.