Pygame Renderer
lerax.render.PygameRenderer
Bases:
PyGame renderer implementation.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
Transform from world coordinates to screen pixels. |
|
|
The width of the rendering window in pixels. |
|
|
The height of the rendering window in pixels. |
|
|
The PyGame surface representing the rendering window. |
|
|
The background color of the rendering window. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
|
The width of the rendering window in pixels. |
required |
height
|
|
The height of the rendering window in pixels. |
required |
background_color
|
|
The background color of the rendering window. |
|
transform
|
|
Transform from world coordinates to screen pixels. |
None
|
__init__
__init__(
width: int,
height: int,
background_color: Color = WHITE,
transform: Transform | None = None,
) -> None
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,
)