πUser guide
User guide on how to use the Dynasty Text 3D
1. Using the Text 3D
DO NOT trigger this function on every tick; it is meant to be activated as a toggle.
You can use the text 3D as showed in the example bellow:
exports['dynasty_text3d']:Text3D({
id = "Default text 3D ID",
coords = vec3(0, 0, 0),
distance = 3,
markerDistance = 10.0,
marker = true,
key = "E",
message = "Default Text 3D message",
})
2. Default Text 3D
In case you use a notification and don't fill any of the parameters, it will be filled with the value stated in the Config.file. For example if the parameter keyBoxColor
is not used, it will be filled with the value 0,255,192,130
in this case.
Config.DefaultText3D = {
id = "Default text 3D ID",
coords = vec3(0, 0, 0),
distance = 1.5,
markerDistance = 3.0,
markerColor = { 0, 255, 192, 255 },
marker = true,
key = "E",
keyBoxColor = { 0, 255, 192, 130 },
keyTextColor = { 255, 255, 255, 255 },
message = "Default Text 3D message",
messageBoxColor = { 0, 255, 192, 130 },
messageTextColor = { 255, 255, 255, 255 },
enabled = true,
}
3. Text 3D configuration
3.1 ID
id = "Default text 3D ID"
In this case the ID you use to call this Text 3D is Default text 3D ID
3.2 Coords
coords = vec3(0, 0, 0)
In this case the coords the Text 3D will appear are vec3(0, 0, 0)
3.3 Distance
distance = 1.5
In this case the distance from where you can see the Text 3D is 1.5
3.4 Marker distance
markerDistance = 3.0
In this case the distance from where you can see the marker is 3.0
3.5 Marker color
markerColor = { 0, 255, 192, 255 }
In this case the color of the marker is 0, 255, 192, 255
3.6 Marker enable
marker = true
In this case the marker enable is true
3.7 Key
key = "E"
In this case the key that appears is E
3.8 Key box color
keyBoxColor = { 0, 255, 192, 130 }
In this case the color of the key box is 0, 255, 192, 130
3.9 Key text color
keyTextColor = { 255, 255, 255, 255 }
In this case the color of the key text is 0, 255, 192, 130
3.10 Message
message = "Default Text 3D message"
In this case the message of the Text 3D is Default Text 3D message
3.11 Message box color
messageBoxColor = { 0, 255, 192, 130 }
In this case the message box color is 0, 255, 192, 130
3.11 Message text color
messageTextColor = { 255, 255, 255, 255 }
In this case the message text color is 0, 255, 192, 130
3.12 Text 3D enable
enabled = true
In this case the text 3D enable is true
4. Multiple Text 3D options
The example bellow shows how to use multiple options
exports['dynasty_text3d']:Text3D({
id = "text-1",
coords = vec3(0, 0, 0),
distance = 3, -- distance to open the menu dialog
markerDistance = 10.0, -- distance to show the marker
marker = true, -- ACTIVATE THE MARKER ONLY FOR THE FIRST ELEMENT
key = "E",
message = "Buy equipment",
})
exports['dynasty_text3d']:Text3D({
id = "text-2",
coords = vec3(0, 0, 0),
distance = 3, -- distance to open the menu dialog
key = "F",
message = "Sell equipment",
})
exports['dynasty_text3d']:Text3D({
id = "text-3",
coords = vec3(0, 0, 0),
distance = 3, -- distance to open the menu dialog
key = "G",
message = "Deposit objects",
})
1. Text 3D position
Let's take the example above. If you have 3 options in the same position, you can also position them up or down depending on your need with the parameter position
exports['dynasty_text3d']:Text3D({
id = "text-2",
coords = vec3(0, 0, 0),
distance = 3, -- distance to open the menu dialog
key = "F",
message = "Sell equipment",
position = { x = 0.0, y = 0.04 },
})
5. Add functionality to the Text 3D
5.1 Install Ox_Lib
5.2 Add ox_lib to the script
Go to fxmanifest.lua file inside your script and add the code below
shared_scripts {
'@ox_lib/init.lua'
}
5.2 Add ox_lib to the script
Add ox_lib pointer to your script as the example shown below
local mechanic1 = lib.points.new({
coords = (0.0, 0.0, 0.0), --- the coords of the place you want the interaction
distance = 5, -- distance from the coord to work
dunak = 'nerd',
})
local garage1Key = lib.addKeybind({
name = 'mechanic',
description = 'press E to open mechanic menu',
defaultKey = 'E',
onPressed = function(self)
print("Here you put your function to open mechanic menu")
end,
})
mechanic1Key:disable(true) -- disables the keybind
function garage1:onEnter()
garage1Key:disable(false) -- enables the keybind
end
function garage1:onExit()
garage1Key:disable(true) -- disables the keybind
end
6. Remove Text 3D
We use the ID of the Text 3D to remove it like the example below
exports['dynasty_text3d']:DeleteText3D('DefaultText')
In this example the Text 3D with the ID DefaultText
is removed
Last updated