Video Renderer
lerax.render.VideoRenderer
Bases:
Renderer wrapper that records frames to a video file.
It forwards all drawing operations to the underlying renderer and captures
the framebuffer on each call to draw(). When close() is called, the
accumulated frames are written to output_path as a video.
Note
This renderer is not JIT-safe and is intended for use in Python loops
(e.g. via env.render_states / env.render_stacked).
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
Transform from world space to pixel space. |
|
|
The underlying renderer to which drawing operations are forwarded. |
|
|
Path to the output video file. |
|
|
Frames per second for the output video. |
|
|
List of captured frames. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inner
|
|
The underlying renderer to which drawing operations are forwarded. |
required |
output_path
|
|
Path to the output video file. |
required |
fps
|
|
Frames per second for the output video. |
60.0
|
draw_circle
draw_line
draw_line(
start: Float[ArrayLike, "2"],
end: Float[ArrayLike, "2"],
color: Color,
width: Float[ArrayLike, ""] = 1,
)
draw_rect
draw_rect(
center: Float[ArrayLike, "2"],
w: Float[ArrayLike, ""],
h: Float[ArrayLike, ""],
color: Color,
)
draw_text
draw_text(
center: Float[ArrayLike, "2"],
text: str,
color: Color,
size: Float[ArrayLike, ""] = 12,
)