Thorpy | A GUI library for Pygame | Game Engine library
kandi X-RAY | Thorpy Summary
kandi X-RAY | Thorpy Summary
ThorPy is a free GUI library intended for use with pygame. More informations on
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a handler for the given variable
- Set painter style .
- Stitch the rectangle .
- make display options setter
- Set hover state .
- Launch an element .
- Blit the surface
- Store children of children
- Lightweight an alpha surface .
- Store rectangles .
Thorpy Key Features
Thorpy Examples and Code Snippets
Community Discussions
Trending Discussions on Thorpy
QUESTION
I am fiddling with a Raspberry Pi 2 and a 2.8" TFT touch screen attached to the Pi's GPIO. The Pi is also connected to a HDMI monitor.
My issue is that my Python3 pygame script is not able to use the TFT screen, but always displays on my HDMI screen instead.
I've installed the latest vanilla Raspbian ready-to-use distro and followed the TFT screen installation steps, everything works well: the TFT can display the console and X without issue. The touchscreen is calibrated and moves the cursor correctly. I can also see a new framebuffer device as /dev/fb1
.
I've tried the following to test this new device:
...ANSWER
Answered 2019-Mar-04 at 15:16I have been fiddling around that for far too many hours now, but at least I have found what I'd call a decent workaround, if not a solution.
TL;DRI've kept using pygame for building my graphics/GUI, and switched to evdev for handling the TFT touch events. The reason for using evdev rather than pygame's built-in input management (or pymouse, or any other high level stuff) is explained in the next section.
In a nutshell, this program builds some graphics in memory (RAM, not graphic) using pygame, and pushes the built graphics as bytes into the TFT screen framebuffer directly. This bypasses any driver so it is virtually compatible with any screen accessible through a framebuffer, however it also bypasses any potential optimizations coming along what would be a good driver.
Here is a code sample that makes the magic happen:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Thorpy
You can use Thorpy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page