GIFRecorder
Inherits: RefCounted < Object
Records a viewport, window, or screen to an animated GIF.
Description
Works in the editor and in exported templates. Capture a Viewport with start_viewport(), the engine window with start_window(), or a display with start_screen(). Tests and manual control can push images with add_frame(). Call stop() then save(), or use record_viewport() for a timed clip.
Properties
|
||
|
||
|
||
|
||
|
Methods
is_recording() const |
|
record_viewport(viewport: Viewport, path: String, duration_sec: float, fps: int = 12) static |
|
start_screen(screen: int = 0) |
|
start_viewport(viewport: Viewport) |
|
stop() |
Signals
recording_finished(animation: GIFTexture, path: String) 🔗
Emitted when stop() finishes. path is set when a pending save path was provided.
Enumerations
enum Source: 🔗
Source SOURCE_VIEWPORT = 0
Capture one viewport.
Source SOURCE_WINDOW = 1
Capture the engine or game window.
Source SOURCE_SCREEN = 2
Capture a display.
Property Descriptions
Enables encoder dithering.
Capture rate and encoded frame delay.
Netscape loop count written on encode. 0 is infinite.
Optional cap. 0 uses blazium/gif/max_frames.
Vector2i max_size = Vector2i(480, 270) 🔗
Downscales captured frames that exceed this size. (0, 0) disables scaling.
Method Descriptions
Error add_frame(image: Image) 🔗
Appends a prepared frame. Used by unit tests and manual capture.
Returns true while a timed capture is running.
Error record_viewport(viewport: Viewport, path: String, duration_sec: float, fps: int = 12) static 🔗
Records viewport for duration_sec seconds and writes path.
Encodes collected frames to path.
Error start_screen(screen: int = 0) 🔗
Starts capturing a display.
Error start_viewport(viewport: Viewport) 🔗
Starts capturing viewport each process frame.
Starts capturing the main engine or game window, including decorations.
GIFTexture stop() 🔗
Stops capture and returns the recorded animation.