Skip to main content

Overlay

A package that creates and manipulates screen overlays based on tkinter.

Platforms

  • Mac OS (tested and works)
  • Linux (not tested)
  • Windows (tested and does not work)

Installation

pip install overlay

Usage

A basic overlay is created as such:

from overlay import Window

win = Window()
Window.launch()

The constructor of the Window class takes the following (optional) parameters:

  • size: tuple, the dimension (width, height) of the overlay window.
  • position: tuple, the position of the overlay (on screen).
  • transparent: bool, whether to set the overlay background transparent.
  • alpha: float [0, 1], the alpha (transparency) of the overlay.
  • draggable: bool, whether the window can be dragged

Note that the parameters mentioned above can be edited any time as attributes of an instance of Window.

In order to edit the content of a overlay, one needs to obtain the root of the overlay, upon which all else shall be build.

import tkinter as tk
from overlay import Window

win = Window()
label = tk.Label(win.root, text="Window_0")
label.pack()
Window.launch()

Multiple overlays can be created just as easily:

import tkinter as tk
from overlay import Window

win_0 = Window()
label_0 = tk.Label(win_0.root, text="Window_0")
label_0.pack()
win_1 = Window()
label_1 = tk.Label(win_1.root, text="Window_1")
label_1.pack()
Window.launch()

The following program covers a brief explaination on other methods of the Window class.

import tkinter as tk
from time import sleep
from overlay import Window

def other_stuff(text):
	'''A simple demonstration. The usage of sleep is to emphasize the effects of each action.'''
	print(text)
	sleep(2)
	win_0.hide() # Hides the overlay.
	sleep(1)
	win_0.show() # Shows the overlay.
	sleep(1)
	win_0.focus() # Sets focus to overlay.
	win_1.center() # Moves the overlay to the center of the screen.
	sleep(1)
	Window.hide_all() # Hides all overlays.
	sleep(1)
	Window.show_all() # Shows all overlays.
	sleep(1)
	win_0.destroy() # Kills the overlay.
	sleep(1)
	Window.destroy_all() # Kills all overlays and ends the mainloop.


'''Creates two windows.'''
win_0 = Window()
label_0 = tk.Label(win_0.root, text="Window_0")
label_0.pack()
win_1 = Window()
label_1 = tk.Label(win_1.root, text="Window_1")
label_1.pack()

Window.after(2000, other_stuff, 'Hello World') # Identical to the after method of tkinter.Tk.

Window.launch()

Release files for overlay 1.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for overlay 1.1.5
File Size Uploaded
overlay-1.1.5.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for overlay 1.1.5
File Interpreter ABI Platform
overlay-1.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / overlay-1.1.5.tar.gz

Download URL overlay-1.1.5.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0a1b2c6676b82e32f88ae6dd08f83247a5c1fee29a8f2eb7b77fdce1e8e0c260
BLAKE2b-256 checksum
How to use checksums
1dbe38ccc94ca2f8bf3e85b2b7d959f0a19a3a913444e7cf6fb3566c566c2680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / overlay-1.1.5-py3-none-any.whl

Download URL overlay-1.1.5-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fdfb9dc1edaae4e820d4d670d9ce3a4776cbfe65196b9b187fadd77463120a8
BLAKE2b-256 checksum
How to use checksums
9db054ee29a640137ed7918b52be564a8e14a95162fff0119fa77d4d7e8f6357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.1.5 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page