3D Text

posted 01-03-2022 19:12 1.151 views 3 replies
MatheX
0 Posts
25 Credits
N/A Since
#1 1.151 views 3 replies
does somebody have some clean script for custom 3D texts?
replies (3)
programok3
404 Posts
35 Credits
Nov 2021 Since
#1
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
local player = PlayerPedId()
local coords = GetEntityCoords(player)
local coords_plus = vector3(coords.x, coords.y, coords.z+1.2)
local r = 58
local g = 115
local b = 208
local a = 215
local my_string = "My text over head"
DrawText3D(coords_plus,my_string,scale_x,scale_y,r,g,b,a)
end
end)

function DrawText3D(coords, text, scale_x, scale_y, r, g, b, a)
local onScreen,_x,_y = World3dToScreen2d(coords)
local game_coords = GetGameplayCamCoord()
local dist = #(game_coords - coords)

local scale = (1/dist)*2
local fov = (1/GetGameplayCamFov())*100
local scale = scale*fov

if onScreen then
SetTextScale(scale_x, scale_y)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(r, g, b, a)
SetTextEntry("STRING")
SetTextCentre(1)
SetTextOutline()
AddTextComponentString(text)
DrawText(_x,_y)
end
end
suprimeet
178 Posts
1,835 Credits
Oct 2021 Since
#2

programok3,
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
local player = PlayerPedId()
local coords = GetEntityCoords(player)
local coords_plus = ...

??
maddison865
25 Posts
26 Credits
Aug 2021 Since
#3
Following

You must be logged in to reply

Login Register