Easily create overlay on top of any game/application
Project description
Table of Contents
Description 📸
Easily create and manage overlay for any game/appliction using pyopengl and glfw
Preview 📸
Installation 💾
Install from pip
pip install pyoverlay
Install from source
*note that the wheel file may not have this name*git clone https://github.com/majvax/pyoverlay.git
cd pyoverlay
python -m build
cd dist
pip install pyoverlay.whl
🚨 don't forget to install litGL🚨
pip install git+https://github.com/ncreati/litGL
Usage 📕
Exemple using a fonction
from pyoverlay import Overlay, Point, Rect, RGBA, Color
import win32con
# create the function that will be ran every frames
def on_tick(overlay: Overlay) -> None:
# https://learn.microsoft.com/fr-fr/windows/win32/inputdev/virtual-key-codes
if overlay.get_input(win32con.VK_ESCAPE):
# stops our overlay
overlay.stop()
# only draw if the target is the foreground window
if overlay.target.is_valid:
overlay.draw_test(overlay.target.rect)
if __name == "__main__":
# create our overlay object
overlay = Overlay("Calculator")
overlay.on_tick = on_tick
# create the overlay
overlay.create()
# infinite loop
overlay.run()
Exemple using a class
from pyoverlay import Overlay, Point, Rect, RGBA, Color
import win32con
class OnTick:
def __init__(self):
self.fov_radius = 50
# create the method that will be ran every frames
def __call__(self, overlay: Overlay):
# https://learn.microsoft.com/fr-fr/windows/win32/inputdev/virtual-key-codes
if overlay.get_input(win32con.VK_ESCAPE):
# stops our overlay
overlay.stop()
# increase the fov on PAGE_UP
if overlay.get_input(win32con.VK_PRIOR):
self.fov_radius += 1
# decrease the fov on PAGE_DOWN
if overlay.get_input(win32con.VK_NEXT):
self.fov_radius -= 1
# only draw if the target is the foreground window
if overlay.target.is_valid:
# draw an empty circle
overlay.draw_empty_circle(overlay.target.rect.center, self.fov_radius, Color.WHITE)
if __name == "__main__":
# create our overlay object
overlay = Overlay("Calculator")
overlay.on_tick = on_tick
# create the overlay
overlay.create()
# infinite loop
overlay.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyoverlay-1.0.2.tar.gz
(8.0 kB
view details)
Built Distribution
File details
Details for the file pyoverlay-1.0.2.tar.gz
.
File metadata
- Download URL: pyoverlay-1.0.2.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fe5f3842b02681012643c2a1740d603de86e0a49a00fc0dda52fde88ce243b7 |
|
MD5 | 032f95665721352f7243c5f47186efae |
|
BLAKE2b-256 | 9542ed02b7e8f6354dc842a76b614eb1c5a609d11bdc288d95e3a978ead3055d |
File details
Details for the file pyoverlay-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyoverlay-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e983ea06ce36a5f9bf524871bbed2516f1a3fa34d1e0f2b3099bef1a5d513e2 |
|
MD5 | ea73c8976dd023c9aa34958fea86ec85 |
|
BLAKE2b-256 | 1b0fea8474d8215951cd2c97cdf28dbe036436ebeb206704622bf9e874ea2419 |