createDui
Client
Opens a web page off screen, with a transparent background, and gives it back as an image that can be drawn.
dui|false createDui(string url, int width, int height)
Parameters
| Name | Type | Description |
|---|---|---|
| url | string | The page's address. |
| width | int | Width in pixels, from 1 to 4096. |
| height | int | Height in pixels, from 1 to 4096. |
Returns
The created dui element, or false if it could not be created.
The dui works anywhere an image is taken, such as dxDrawImage or engineSetTxdTexture. The page's sound plays through the game's audio. destroyElement closes the page.
Example
local dui = createDui("https://example.com", 1024, 576)
addEventHandler("onClientRender", root, function()
dxDrawImage(100, 100, 512, 288, dui)
end)NoteA size outside 1 to 4096 logs a warning and returns
false.