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
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.4.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file pyoverlay-1.0.4.tar.gz
.
File metadata
- Download URL: pyoverlay-1.0.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c96fd1a9c30dcee91469b866ddd83ef4368244e3443ce72847316f9967a6f8 |
|
MD5 | 9db1275e627582362126970d9b906325 |
|
BLAKE2b-256 | d4edb80b0d95e211ebf8d02ec1dff58e68f06d6c439f27f7428c56228a2cb101 |
File details
Details for the file pyoverlay-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: pyoverlay-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.8 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 | 8f8d955038f288406ce476bade74df5398d28a1c1ed2957bca991add35ee4704 |
|
MD5 | 88951d982ad8367cffb6c783c91b084e |
|
BLAKE2b-256 | e799df5c749efcb7a94c7fa531df7aab5739149c3e6777dd6d6ac444b666b9f2 |