Functions
Here you will find functions and example code on how to use our Dialog System.
Camera
The Camera can only be invoked on the Client-Side!
Creating Camera
exports["is_dialog"]:createCamera(entity, data)
entity:
object
data:
table
ornil
camera:
table
ornil
position:
table
ornil
x:
number
ornil
y:
number
ornil
z:
number
ornil
offset:
table
ornil
x:
number
ornil
y:
number
ornil
z:
number
ornil
fov:
number
ornil
ease:
boolean
ornil
easeTime:
number
ornil
animation:
table
ornil
dict:
string
anim:
string
Example Usage
-- Example 1: Simple Creating Camera with settings from config.lua
exports["is_dialog"]:createCamera(entity)
-- Example 2: Creating Camera
exports["is_dialog"]:createCamera(entity, {
camera = {
position = {
x = 0.0,
y = 0.8,
z = 0.7,
},
offset = {
x = 0.0,
y = 0.0,
z = 0.5,
},
fov = 65.0,
ease = true,
easeTime = 1000,
},
animation = {
dict = "missfbi3_party_d",
anim = "stand_talk_loop_a_male1",
},
})
Destroying Camera
exports["is_dialog"]:destroyCamera(data)
data:
table
ornil
ease:
boolean
ornil
easeTime:
number
ornil
Example Usage
-- Example 1: Simple Destroying Camera with settings from config.lua
exports["is_dialog"]:destroyCamera()
-- Example 2: Destroying Camera
exports["is_dialog"]:destroyCamera({
ease = true,
easeTime = 1000,
})
Getting Camera State
exports["is_dialog"]:isCameraActive()
Example Usage
-- Example 1: Simple Getting Camera State
exports["is_dialog"]:isCameraActive()
Dialog
The Camera can only be invoked on the Client-Side!
Creating Dialog
exports["is_dialog"]:showDialog(data)
data:
table
ornil
audio:
table
ornil
path:
string(audio/yourAudioFile.mp3)
ornil
volume:
number
ornil
title:
table
ornil
text:
string
ornil
background:
table
ornil
primary:
string(hex)
ornil
secondary:
string(hex)
ornil
additional:
table
ornil
text:
string
ornil
icon:
string
ornil
background:
table
ornil
primary:
string(hex)
ornil
secondary:
string(hex)
ornil
message:
table
ornil
text:
string
ornil
typeEffect:
number
orboolean
ornil
buttons:
table
ornil
button:
indexed table
input:
boolean
message:
string
type:
text
ornumber
icon:
table
ornil
name:
string
ornil
color:
string(hex)
ornil
onSelect:
function
Example Usage
-- Example 1: Simple Creating Dialog with settings from config.lua
exports["is_dialog"]:showDialog()
-- Example 2: Creating Basic Dialog
exports["is_dialog"]:showDialog({
title = {
text = "Example Title",
},
message = {
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin porttitor purus et posuere molestie.",
},
buttons = {
{
input = true,
message = "Provide Your Full Name",
type = "text",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = true,
message = "Provide Your Age",
type = "number",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = false,
message = "Test Button 1",
icon = {
name = "fa-solid fa-house",
color = "#ff425d",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 2",
icon = {
name = "fa-solid fa-house",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 3",
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
},
})
-- Example 3: Creating Advanced Dialog
exports["is_dialog"]:showDialog({
audio = {
path = "audio/example.mp3",
volume = 50,
},
title = {
text = "Example Title",
background = {
primary = "#00243a",
secondary = "#050f19",
},
},
additional = {
text = "Example Additional",
icon = "fa-solid fa-code",
background = {
primary = "#ff425d",
secondary = "#b7162b",
},
},
message = {
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin porttitor purus et posuere molestie.",
typeEffect = 25,
},
buttons = {
{
input = true,
message = "Provide Your Full Name",
type = "text",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = true,
message = "Provide Your Age",
type = "number",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = false,
message = "Test Button 1",
icon = {
name = "fa-solid fa-house",
color = "#ff425d",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 2",
icon = {
name = "fa-solid fa-house",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 3",
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
},
})
Destroying Dialog
exports["is_dialog"]:hideDialog()
Example Usage
-- Example 1: Simple Destroying Dialog
exports["is_dialog"]:hideDialog()
Getting Dialog State
exports["is_dialog"]:isDialogActive()
Example Usage
-- Example 1: Simple Getting Dialog State
exports["is_dialog"]:isDialogActive()
Camera & Dialog Usage
-- Example 1: Simple Dialog & Camera code
exports["is_dialog"]:createCamera(entity)
exports["is_dialog"]:showDialog({
title = {
text = "Example Title",
},
message = {
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin porttitor purus et posuere molestie.",
},
buttons = {
{
input = true,
message = "Provide Your Full Name",
type = "text",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = true,
message = "Provide Your Age",
type = "number",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = false,
message = "Test Button 1",
icon = {
name = "fa-solid fa-house",
color = "#ff425d",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 2",
icon = {
name = "fa-solid fa-house",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 3",
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
},
})
exports["is_dialog"]:destroyCamera()
-- Example 2: Advanced Dialog & Camera code
exports["is_dialog"]:createCamera(entity, {
camera = {
position = {
x = 0.0,
y = 0.8,
z = 0.7,
},
offset = {
x = 0.0,
y = 0.0,
z = 0.5,
},
fov = 65.0,
ease = true,
easeTime = 1000,
},
animation = {
dict = "missfbi3_party_d",
anim = "stand_talk_loop_a_male1",
},
})
exports["is_dialog"]:showDialog({
audio = {
path = "audio/example.mp3",
volume = 50,
},
title = {
text = "Example Title",
background = {
primary = "#00243a",
secondary = "#050f19",
},
},
additional = {
text = "Example Additional",
icon = "fa-solid fa-code",
background = {
primary = "#ff425d",
secondary = "#b7162b",
},
},
message = {
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin porttitor purus et posuere molestie.",
typeEffect = 25,
},
buttons = {
{
input = true,
message = "Provide Your Full Name",
type = "text",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = true,
message = "Provide Your Age",
type = "number",
onSelect = function(id, input)
exports["is_dialog"]:hideDialog()
print(("Input: %s"):format(input))
end
},
{
input = false,
message = "Test Button 1",
icon = {
name = "fa-solid fa-house",
color = "#ff425d",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 2",
icon = {
name = "fa-solid fa-house",
},
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
{
input = false,
message = "Test Button 3",
onSelect = function(id)
exports["is_dialog"]:hideDialog()
print(("Button: %s"):format(id))
end
},
},
})
exports["is_dialog"]:destroyCamera({
ease = true,
easeTime = 1000,
})
Last updated