trying to use this -
[lua]
local cinHTML = vgui.Create( "HTML", main )
cinHTML:SetSize( ScrW() - 20, ScrH() - 65 )
cinHTML:SetPos( 5, 50 )
cinHTML:OpenURL( "www.youtube.com/" )
function cinHTML:OpeningURL( url, target )
print( "yo" )
end
[/lua]
nothing is printing.
These PANEL hooks are broken and do not work.
[QUOTE=Robotboy655;42140002]These PANEL hooks are broken and do not work.[/QUOTE]
oh, is there any way to get the url from an html panel?
If you just want to open a panel on say initial spawn or so, you can use this by adding the hook.
Think this is mostely from the ULX MOTD, so credit goes to Ulysses.
[LUA]
local window = vgui.Create( "DFrame" )
if ScrW() > 640 then -- Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( "Server Information" )
window:SetVisible( true )
window:MakePopup()
local html = vgui.Create( "HTML", window )
local button = vgui.Create( "DButton", window )
button:SetText( "Close" )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )
html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
html:OpenURL("http://yoururl.com")
[/LUA]
I am making a youtube browser for a special cinema feature i am going to be adding to a server. It will bring up youtube in an html panel, from there you can select a video, click a "use video" button, and it will pull the video url, manipulate the string and display a full screened-version on the world. I have a different idea I am going to try.
Sorry, you need to Log In to post a reply to this thread.