blinka_displayio_pygamedisplay

Use CircuitPython displayio code on PC and Raspberry Pi output to a PyGame window instead of a physical display.

  • Author(s): Tim C

Implementation Notes

Software and Dependencies:

class blinka_displayio_pygamedisplay.PyGameDisplay(width=0, height=0, icon=None, caption='Blinka Displayio PyGame', native_frames_per_second=60, flags=0, **kwargs)

PyGame display driver

Represents one PyGame window. Uses None for all display hardware parameters.

width - width of the window. A value of zero maximizes the window height - height of the window. A value of zero maximizes the window icon - optional icon for the PyGame window caption - caption for the PyGame window native_frames_per_second - high values result in high cpu-load flags - pygame display-flags, e.g. pygame.FULLSCREEN or pygame.NOFRAME

property auto_refresh: bool

True when the display is refreshed automatically.

check_quit()

Check if the quit button on the window is being pressed.

event_loop(interval=None, on_time=None, on_event=None, events=None)

pygame event-loop. Has to be called by the main thread. This method terminates in case of a QUIT-event. An optional callback on_time is executed every interval seconds. Use this callback for application specific logic.

refresh(*, target_frames_per_second=60, minimum_frames_per_second=1)

While normal display-objects call this method also within a refresh loop, this implementation uses this method only for explicit updates. Note that we cannot just call the update-logic directly, since the pygame-display was created on another thread.