Skip to content

Easily create overlay on top of any game/application

License

Notifications You must be signed in to change notification settings

majvax/pyoverlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

PyOverlay

GitHub Repo stars GitHub issues

Caution

This project is not mature enough, I do not plan to add update soon so you may need to adapt the overlay to your need

Table of Contents
  1. Description
  2. Preview
  3. Getting Started

Description 📸

Easily create and manage overlay for any game/appliction using pyopengl and glfw

Preview 📸

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()

About

Easily create overlay on top of any game/application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages