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 or nil

    • camera: table or nil

      • position: table or nil

        • x: number or nil

        • y: number or nil

        • z: number or nil

      • offset: table or nil

        • x: number or nil

        • y: number or nil

        • z: number or nil

      • fov: number or nil

      • ease: boolean or nil

      • easeTime: number or nil

    • animation: table or nil

      • 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 or nil

    • ease: boolean or nil

    • easeTime: number or nil

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 or nil

    • audio: table or nil

      • path: string(audio/yourAudioFile.mp3) or nil

      • volume: number or nil

    • title: table or nil

      • text: string or nil

      • background: table or nil

        • primary: string(hex) or nil

        • secondary: string(hex) or nil

    • additional: table or nil

      • text: string or nil

      • icon: string or nil

      • background: table or nil

        • primary: string(hex) or nil

        • secondary: string(hex) or nil

    • message: table or nil

      • text: string or nil

      • typeEffect: number or boolean or nil

    • buttons: table or nil

      • button: indexed table

        • input: boolean

        • message: string

        • type: text or number

        • icon: table or nil

          • name: string or nil

          • color: string(hex) or nil

        • 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