I want to have static scale of text but when I am too far or too cloose to target position becomes wrong. Is there are any ways how to fix it?
-
Looks normal
https://i.imgur.com/D2DCE75.jpg -
Text overlays on each other
https://i.imgur.com/jrBJ9lB.jpg -
Too big spaces when I am close to target
https://i.imgur.com/CD9EH7K.jpg
How I am drawing text:
x, y, z = table.unpack(GetEntityCoords(ped, true))
DrawName3D(x, y, z + 1.30, GetPlayerName(id))
function DrawName3D(x,y,z, text) -- some useful function, use it if you want!
SetDrawOrigin(x, y, z, 0);
SetTextFont(0)
SetTextProportional(0)
SetTextScale(0.0, 0.23)
SetTextColour(19, 232, 46, 240)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(0.0, 0.0)
ClearDrawOrigin()
end