DUI

DUI (Dynamic UI) allows you to render a web page as a texture on any in-game surface — screens, billboards, laptops, phones, etc.

CreateDui

Creates a new DUI instance.

local dui = KOJA.Client.CreateDui(opts)
Field
Type
Default
Description

url

string

URL to load inside the DUI

width

number

1280

Texture width in pixels

height

number

720

Texture height in pixels

Returns DuiInstance

DuiInstance

Properties

Property
Type
Description

id

string

Unique identifier

url

string

Current URL

handle

long

Native DUI handle

txd

string

Texture dictionary name

txn

string

Texture name

Methods

setUrl

Navigate the DUI to a new URL.

sendMessage

Send a JSON-serialisable message into the DUI's JavaScript.

The web page receives it as a message event. In your JS/TS:

getHandle / getTextureDict / getTextureName

replaceTexture

Replace an existing game texture with this DUI's texture.

removeReplaceTexture

Restore the original texture.

destroy

Destroy the DUI and free resources.

Examples

Replace a game texture (e.g. a TV screen)

Draw DUI on a custom surface using scaleform

Send live data to the DUI

Last updated