Garry's Mod Wiki

Revision Difference

IVideoWriter:AddFrame#529491

<function name="AddFrame" parent="IVideoWriter" type="classfunc"> <description>Adds the current framebuffer to the video stream.</description> <realm>Client</realm> <args> <arg name="frameTime" type="number">Usually set to what <page>Global.FrameTime</page> is, or simply 1/fps.</arg> <arg name="downsample" type="boolean">If true it will downsample the whole screenspace to the videos width and height, otherwise it will just record from the top left corner to the given width and height and therefor not the whole screen.</arg> </args> </function> <example> <description>If ActiveVideo was a <page>IVideoWriter</page>, it would record the screen every frame.</description> <code> --Taken from /lua/menu/video.lua hook.Add( "DrawOverlay", "CaptureFrames", function() if ( !ActiveVideo ) then return end ActiveVideo:AddFrame( FrameTime(), true ); ActiveVideo:AddFrame( FrameTime(), true ) end ) </code> </example>