CreateWebUI: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|CreateWebUI(x, y, width, height [, ZOrder, FrameRate])}} {{FuncParameters}} {{FuncParam|x|__EDIT_M..." |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Creates a new WebUI}} | ||
{{FuncSyntax|CreateWebUI(x, y, width, height [, | {{FuncSyntax|CreateWebUI(x, y, width, height [, zOrder, frameRate])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|x| | {{FuncParam|x|screen pixel x}} | ||
{{FuncParam|y| | {{FuncParam|y|screen pixel y}} | ||
{{FuncParam|width| | {{FuncParam|width|pixel width}} | ||
{{FuncParam|height | | {{FuncParam|height |pixel height}} | ||
{{ | {{FuncParamOptional|zOrder|order in which the webui's are rendered. (Default: 1)}} | ||
{{FuncParamOptional| | {{FuncParamOptional|frameRate|rendering rate (default: 16).}} | ||
{{FuncReturnValue| | {{FuncReturnValue|web (number)}} | ||
== Example == | == Example == | ||
Creates a fullscreen Web UI. | |||
<syntaxHighlight lang="lua"> | |||
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) | |||
</syntaxHighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{WebFunctions}} |
Latest revision as of 13:31, 5 January 2020
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)