[RELEASE] Dimentional Text, 3D Text Library

Hey everyone,

In the process of making my server, I optimized Jeva’s motiontext script so that I could use it more flexibly, and with it consuming less server resources.

With this script, you will be able to create / delete 3D text dynamicaly, all of it being optimized.

Please keep in mind this is a library, which means that you will have to manually implement this script in your resources, by calling the export functions listed below

This script consumes 0.01ms when no text is displayed, and ~0.15ms when text is being displayed.

This code is open source obviously, so I encourage anyone who wants to, to improve this resource / fix potential issues / add new features (like the rectangle background for the text I tried doing but commented out).

If you want to contribute feel free to make a pull request !

  • Do note that using Draw3DTextThisFrame is very resource consuming even when not displayed on screen.
  • I recommend you initialize the 3D text with Draw3DTextPermanent and then delete it to your need with Delete3DText

Documentation

  • Draw3DTextPermanent - Draws 3D text permanently on specific coordinates.
exports["dimentional-text"]:Draw3DTextPermanent(
   "unique-identifier", -- unique identifier specific to that text
   {x = -1377.514282266, y = -2852.64941406, z = 13.9448}, -- Coordinates
   {
       content = "Example text", -- This is the string that you want to be displayed
       rgba = {255 , 255, 255, 255}, --T he color value of the text in RGBA 
       textOutline = true, -- Text outline
       scaleMultiplier = 1, -- Text Size Multiplier
       font = 0, -- Font type (0-5)
   }, 150, -- radius (in units) in which the player will be able to see the text
   4 -- Perspective Scale
)
  • Draw3DTextTimeout - Draws 3D text with timeout on specific coordinates.
exports["dimentional-text"]:Draw3DTextTimeout(
   "unique-identifier", -- unique identifier specific to that text
   {x = -1377.514282266, y = -2852.64941406, z = 13.9448}, -- Coordinates
   {
       content = "Example text", -- This is the string that you want to be displayed
       rgba = {255 , 255, 255, 255}, --T he color value of the text in RGBA 
       textOutline = true, -- Text outline
       scaleMultiplier = 1, -- Text Size Multiplier
       font = 0, -- Font type (0-5)
   }, 150, -- radius (in units) in which the player will be able to see the text
   4, -- Perspective Scale
   2000 -- Time in ms until the text will disappear.
)
  • Draw3DTextThisFrame - Draws 3D text this frame only on specific coordinates.
exports["dimentional-text"]:Draw3DTextThisFrame(
   {x = -1377.514282266, y = -2852.64941406, z = 13.9448}, -- Coordinates
   {
       content = "Example text", -- This is the string that you want to be displayed
       rgba = {255 , 255, 255, 255}, --T he color value of the text in RGBA 
       textOutline = true, -- Text outline
       scaleMultiplier = 1, -- Text Size Multiplier
       font = 0, -- Font type (0-5)
   }, 150, -- radius (in units) in which the player will be able to see the text
   4 -- Perspective Scale
)
  • Delete3DText - Deletes the 3D permanent / timeout text previously setup
exports["dimentional-text"]:Delete3DText("unique-identifier")

Preview
Release
GitHub

Credits:

3 Likes