Use CircuitPython displayio code on PC and Raspberry Pi outputting to a PyGame window instead of a physical display.
Project description
Introduction
Blinka makes her debut on the big screen! With this library you can use CircuitPython displayio code on PC and Raspberry Pi to output to a PyGame window instead of a hardware display connected to I2C or SPI. This makes it easy to to use displayio elements on HDMI and other large format screens.
Warning: you must check display.running in the main loop to correctly handle the close button!
Dependencies
This driver depends on:
Please ensure all dependencies are available they can be installed with pip3
Optional Dependencies
This driver can optionally make use of these displayio module libraries:
They can be installed with pip3.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install blinka-displayio-pygamedisplay
To install system-wide (this may be required in some cases):
sudo pip3 install blinka-displayio-pygamedisplay
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install blinka-displayio-pygamedisplay
Usage Example
import displayio
from blinka_displayio_pygamedisplay import PyGameDisplay
display = PyGameDisplay(width=320, height=240)
splash = displayio.Group()
display.show(splash)
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00 # Bright Green
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
# Must check display.running in the main loop!
while True:
if display.check_quit():
break
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation
For information on building library documentation, please check out this guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for blinka-displayio-pygamedisplay-2.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ed4284bfece18defc5325050a6010a20b1ff13c6080b53fa2921734defaeda |
|
MD5 | 402a1b40bfc3a21c9585633ee02e2e86 |
|
BLAKE2b-256 | 9a41ef27419fa16ea59ef472cf2019ce7ccdd00a407b4fbb6cc86e689a90c130 |
Hashes for blinka_displayio_pygamedisplay-2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94fba37b2b8136f5c6f0a596892aaacbd63f8f26f78507433beb3f01880a310f |
|
MD5 | 95ebf7e3b44a15a58a17729b54f738fa |
|
BLAKE2b-256 | 5e614d0cec5fd024b70fd707327a8fc5bb007c8741f9be38ccff1864f289b08f |