create
SHAREDCyberM.webui.create(options)
Creates a web surface.
Creation is asynchronous. A show() issued right after create loses the race against the visible flag the request carried, and the surface then never paints at all. So a surface meant to stay up is created with visible = true, and the page shows or hides its own content.
Valid layers: hud, menu, modal, system (needs the webui.system permission), debug.
Parameters
- optionstablerequired
Returns
- surface, or nil
- reason
Example
local overlay = WebUI.create({
entry = "web/index.html",
layer = "hud",
transparent = true,
visible = true -- never false for a permanent overlay
})Registered in ResourceHost.cpp as LuaWebUiCreate (line 6581).
