Python library designed to create customizable overlays for desktop applications. It uses PyQt5 to draw shapes such as circles, rectangles, and lines on a transparent window that stays on top of other windows.
Project description
PythonOverlayLib
The Overlay Library is a Python library designed to create customizable overlays for desktop applications. It uses PyQt5 to draw shapes such as circles, rectangles, and lines on a transparent window that stays on top of other windows. This can be useful for a variety of applications, such as highlighting specific areas of the screen, drawing annotations, or creating custom HUDs for games.
Features
-
Customizable Shapes: The library supports drawing of various shapes including circles, rectangles, and lines. Each shape can be customized with its own position, size, color, and thickness.
-
Transparent Overlay: The overlay is completely transparent, allowing you to see the underlying windows while still displaying the drawn shapes.
-
Always on Top: The overlay window stays on top of other windows, ensuring that the drawn shapes are always visible.
-
Dynamic Drawing: The library supports dynamic drawing through a callback function. This function is called at a regular interval and should return a list of shapes to be drawn. This allows the overlay to be updated dynamically based on your application's state.
Usage
To use the Overlay Library, you need to create an instance of the Overlay
class, passing a callback function that returns a list of shapes to be drawn. You can then call the spawn
method to create the overlay window.
Here's a basic example:
import overlay_lib
from overlay_lib import Vector2D, RgbaColor, SkDrawCircle
def callback():
return [SkDrawCircle(Vector2D(960, 540), 10, RgbaColor(255, 255, 255, 255), 1)]
overlay = overlay_lib.Overlay(
drawlistCallback=callback,
refreshTimeout=1
)
overlay.spawn()
In this example, the callback function returns a list containing a single circle, which is drawn at the center of the screen. The refreshTimeout
parameter determines how often the callback function is called, in milliseconds.
Installation
To install the Overlay Library, you can use pip:
pip install PythonOverlayLib
Contributing
Contributions are welcome! Please feel free to submit a pull request.
License
This project is licensed under the terms of the Apache License 2.0 license.
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
File details
Details for the file pythonoverlaylib-1.2.tar.gz
.
File metadata
- Download URL: pythonoverlaylib-1.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b09f29d1b577d9ff205f437464ebff05f0261329fac32524f367e595223bfb6 |
|
MD5 | e70d4e484bd21bcf311aaf36b15b7ec1 |
|
BLAKE2b-256 | 228f3f90f8d52037f32f778cc019f91065b5deb4a46d9edff44539d9bff1e67a |
File details
Details for the file PythonOverlayLib-1.2-py3-none-any.whl
.
File metadata
- Download URL: PythonOverlayLib-1.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce834223d2eda77219787ec78744ae37cc54e19d835a9d8fbe2ead70890d069 |
|
MD5 | 8b39113fc4c9ca9b3c8c92e627781629 |
|
BLAKE2b-256 | fe9adfff3c828abfffebb7969d551da9dc23a1a146d65a27a3652a8743cb3f04 |