Panel/OpenURL

From Garry's Mod
Jump to: navigation, search
 Panel:OpenURL( )

Contents

Description

Instructs a HTML control to download and parse a HTML script using the passed URL.

Arguments

string URL

URL to open

Examples

Example

Displays the Garry's Mod wiki page.

local frame = vgui.Create( "DFrame" )
frame:SetTitle( "HTML Example" )
frame:SetSize( ScrW() * 0.75, ScrH() * 0.75 )
frame:Center()
frame:MakePopup()

local html = vgui.Create( "HTML", frame )
html:Dock( FILL )
html:OpenURL( "wiki.garrysmod.com" )


Examples

Example

Displays the default loading screen from the html folder.

local frame = vgui.Create( "DFrame" )
frame:SetTitle( "HTML Example" )
frame:SetSize( ScrW() * 0.75, ScrH() * 0.75 )
frame:Center()
frame:MakePopup()

local html = vgui.Create( "HTML", frame )
html:Dock( FILL )
html:OpenURL( "asset://garrysmod/html/loading.html" )

Output:



html openurl example.png
Personal tools
Navigation