[Dev Resource] 3d Text With Outline

3d Text With Outline

Simple function that I had made a while ago, 3d text with boarder outline, options to change font scale and color along with amount of lines. Some helper functions inspired by Native UI. Took a long time to get the numbers right but still sometimes they are off set by a few pixels.

To Use:
You can use this as a resource or as a snippet.

-- x,y,z is the coords where the 3d text should display
-- font is font index I suggest 4
-- scale is scale of the text I suggest 0.35
-- exLines is amount of extra lines there should be, you can check your string before hand for /n default should be 0
-- rgb is a table ex. {r = 255, b = 255, g = 255} 
exports['3dTextWithOutline']:DrawText3DWithOutline(x,y,z,text, font, scale, exLines, rgb)

Download v1.1: 3DTextWithOutline-main (3).zip (3.2 KB)

Example

3 Likes

great script

1 Like

image
But?

lmao its old ok, ill fix that and reupload

Edit: Fixed and reuploaded!

1 Like

Put it on github

Would ya know how to make a /do script that attaches to the ped with this, been trying to draw a rect on the 3dme script forever?

Citizen.CreateThread(function()
    while true do 
        Citizen.Wait(1)
        local x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))
        exports['3dTextWithOutline']:DrawText3DWithOutline(x,y,z,"This is a test", 4, 0.35, 0, { r = 255, g = 255, b = 255 })
    end
end)

NOTE this has NOT been tested as I am on my laptop. Should place a test of “This is a test” in the middle of the player, if you want to change the color or text you can there. Also as stated this is a dev resource, please look over the source and understand how it works before using it in your own resources / server.