Modules
Dui
Lua
Client

Client

Simple and centralised dui creation, supporting sending message, change url and deletion

lib.dui:new

Constructs instance of Dui.

lib.dui:new(data)
  • data: table
    • url: string
    • width: number
    • height: number
    • debug?: boolean

Returns:

  • dui: Dui
    • url: string
    • duiObject: number
    • duiHandle: string
    • runtimeTxd: number
    • txdObject: number
    • dictName: string
    • txtName: string
    • setUrl: function(url: string)
    • sendMessage: function(data: table)
    • remove: function

Usage Example

local dui = lib.dui:new({
	url = ("nui://%s/web/index.html"):format(cache.resource), 
	width = 1920, 
	height = 1080,
	debug = true
})
 
-- Change url
dui:setUrl("https://google.com")
 
-- Send a message
dui:sendMessage({
	action = "display",
	value = true
})
 
-- Destroy
dui:remove()