CreateWebUI

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
CreateWebUI

Type: Function
Context: Client
Introduced: v1.0

Description

Creates a new WebUI

Syntax

CreateWebUI(x, y, width, height [, zOrder, frameRate])

Parameters

  • x
    screen pixel x
  • y
    screen pixel y
  • width
    pixel width
  • height
    pixel height
  • zOrder (optional)
    order in which the webui's are rendered. (Default: 1)
  • frameRate (optional)
    rendering rate (default: 16).

Return Value

  • web (number)

Example

Creates a fullscreen Web UI.

function OnPackageStart()
	WebGuiId = CreateWebUI(0.0, 0.0, 0.0, 0.0, 4, 32)
	LoadWebFile(WebGuiId, "http://asset/"..GetPackageName().."/gui/gui.html")
	SetWebAlignment(WebGuiId, 0.0, 0.0)
	SetWebAnchors(WebGuiId, 0.0, 0.0, 1.0, 1.0)
	SetWebVisibility(WebGuiId, WEB_HITINVISIBLE)
end
AddEvent("OnPackageStart", OnPackageStart)

See also