Open Source Cross-Platform Game Programming

GameGifCap

Records a Game.GameWindow and exports it as an animated GIF.
Compatibility note: this functionality is only available in projects exported to the C#/Windows based platforms (which includes the default VM running on Windows). Be sure to check the isSupported() function.

function isSupported()[link]

Checks to see if the GIF recorder is available for the currently running platform.

Return Value

TypeDescription
boolean

True if the GIF recorder is currently supported.

class GifRecorder[link]

Represents a GIF recording session.

new GifRecorder(fps)[link]

Creates a new GIF recorder instance.

Arguments

NameTypeDescription
fps integer

Frames per second of the game

function clear()[link]

Removes all recorded data up to this point.

function isRecording()[link]

Checks if the recorder is actively recording.

Return Value

TypeDescription
boolean

True if the recorder is recording.

function pause()[link]

Pauses the recording.

function record()[link]

Starts recording the screen.

function save(path)[link]

Saves the Animated GIF to disk.

Arguments

NameTypeDescription
path string

Desired file path to save the file to.

function setTargetSize(width, height)[link]

Sets the desired size of the final image. MUST be called before recording! If this is different than the size of the GameWindow, then the image is stretched.

Arguments

NameTypeDescription
width integer

Width of the image

height integer

Height of the image

Return Value

TypeDescription
GameGifCap.GifRecorder

reference to itself for chaining syntax