Panel.StartAnimate

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:StartAnimate( Integer Milliseconds )
Description:
Starts an animation.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.StartAnimate]Panel.StartAnimate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates and starts a flash animation.
Used onNewerClient.png
Code
function RunTest(ply, cmd, arg)
	Winmain = vgui.Create("DFrame")
	Winmain:SetPos(0,0)
	Winmain:SetSize(800,600)
	Winmain:SetVisible(true)
	Winmain:SetTitle( "StartAnimate() Test" )
	Winmain:MakePopup()
	Winmain:ShowCloseButton(true)
	Winhtml = vgui.Create( "HTML" , Winmain)
	Winhtml:SetPos(0,30)
	Winhtml:SetSize(790,560)
	Winhtml:SetVisible(true)
	local link = "dagobah.net/flash/Touhou_Canyon.swf" // you can put whatever media you want here
	local url = [[<center>
		<OBJECT ID="MediaPlayer" WIDTH="750" HEIGHT="530" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
		STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
		<PARAM NAME="FileName" VALUE="http://]]..link..[[">
		<PARAM name="autostart" VALUE="true">
		<PARAM name="ShowControls" VALUE="false">
		<param name="ShowStatusBar" value="false">
		<PARAM name="ShowDisplay" VALUE="false">
		</OBJECT>
		</center>]] 
	Winhtml:SetHTML( url )
	Winhtml:Refresh(true)
	Winhtml:StartAnimate(100)
end
concommand.Add("animtest", RunTest)
OutputA flash animation is started.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox