[Release] Holograms / Floating text

“it works perfectly.”

Work perfectly with only x and y axis on screen position . Not the way of holo3d text , so where is the Z then? Drawrect man

You’re able to change x,y and z, I know that because I did it, It was on the ground and I changed it to be in mid air

Hmmm, show me then . The word ‘Change Z’

// DrawRect
void DRAW_RECT(float x, float y, float width, float height, int r, int g, int b, int a);

I’ve about your drawrect that u said u can use it with the background

You just need to create a function for Draw3DText with DrawRect.

Example:

function Draw3DText(x,y,z, text)
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    
    SetTextScale(0.40, 0.40)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(1)
    SetTextOutline()
    AddTextComponentString(text)
    DrawText(_x,_y)
    local factor = (string.len(text)) / 370
    DrawRect(_x,_y+0.0150, 0.040+ factor, 0.03, 1, 1, 1, 150)
end

And then just use
Draw3DText( x, y, z, "Text")

1 Like

I cant get it to work at all in my server even at the default x y z

did you add the resource to your server cfg?

yes started with no errors

Same it doesn’t work

Same here except I actually scrolled up in my rcon and found this:

https://gyazo.com/88c6ddebb5eb8ee79547cd74b932fda1

works perfectly it will be much useful :slight_smile: found a way to color each line individually
example:
if GetDistanceBetweenCoords( -419.50, 1166.00, 326.00, GetEntityCoords(GetPlayerPed(-1))) < 10.0 then
Draw3DText( -419.50, 1166.00, 326.00 -1.400, “~r~Discord: discord.me/HailTheSnail~r~”, 4, 0.1, 0.1)
Draw3DText( -419.50, 1166.00, 326.00 -1.600, “~b~Website: www.BadExample.com~b~”, 4, 0.1, 0.1)
Draw3DText( -419.50, 1166.00, 326.00 -1.800, “~g~Twitter: @Example~g~”, 4, 0.1, 0.1)
end

~r~ =red
~b~ =blue
~g~ = green and etc

1 Like

Thanks for the nice release ^^

Hi. Im struggling with you release. When I put the resource in and start up my server (with cleared cache and i haven’t changed the code), nothing shows up. Any idea’s?

Edit: Do i need any other resource?

1 Like

Works perfectly.
Only have 1 question: how to make the line longer?
I’m trying to make a quest in the game and need to write longer text in every line. Now it cuts the line after certain number of letters.
Don’t see in the code where to change the amount of letters in the line.
Help?

I use Chinese, but I don’t know why this happens, and how this hologram modifies the font size.

I don’t know why, I can’t upload pictures.

I can’t upload the picture. The rough problem is that after I edit the text in Chinese, I display garbled characters in the game.

56 SetTextFont(fontId) = SetTextFont(0)

perfect