A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for your Applications.
Project description
splashscreen-engine
A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for your Applications.
Sample Preview
Features
- Background videos
- Background images
- Loading bars
- Text rendering
- Transparency support
- Threaded rendering
- Video looping
- Simple Code
Installation
pip install splashscreen-engine
Example
import splashscreen_engine as splash
import threading
screen = splash.Screen()
screen.size(750,500)
# This Starts The Engine
screen.start()
# Background Video
video = splash.BackgroundVideo(screen,"exampleVid.mp4",fps=30,loop=True)
video.play()
# Loading Bar
bar = splash.LoadingBar(screen)
bar.place()
# Text `loading`
text = splash.Text(screen,"Loading...","impact",20,(325,400))
text.show()
# The screen will not stop and you can perform other processes
threading.Thread(target=screen.mainloop).start()
# LOADING | you can add your `loading` processes here
a = 0
while not a >= 100:
a += 0.3
text.edit(
text=f"loading : {round(a,2)}%"
)
bar.set_progress(a)
screen.wait(0.05)
text.edit(
text=f"loaded : 100%"
)
screen.wait(3)
screen.stop() # Stop the splash screen after loading
"""
if you are using pygame module in your own code, use ` screen.stop(quit_pygame=False) ` instead of ` screen.stop() `
"""
import tkinter # pip install tkinter -- used as main screen for example.
main_screen = tkinter.Tk()
main_screen.geometry("750x500")
main_text = tkinter.Label(main_screen,text="Your Main Screen",font=("impact",40))
main_text.pack()
main_text.mainloop()
Requirements
- pygame
- opencv-python
- numpy
Functions
Basic Window
import splashscreen as splash
screen = splash.Screen()
screen.size(750, 500)
screen.start()
screen.mainloop() # OR threading.Thread(target=screen.mainloop).start()
Stop and Delete Screen
screen.stop() # Use screen.stop(quit_pygame = False) if you are working with pygame module.
Set Size for your window
screen.size(750,500) # Arguments : width , height , fullscreen
# OR
screen.size(fullscreen=True) # For Fullscreen
Set title for your window
screen.title("Your Title")
Set Background color
screen.set_bg_color((255,0,0)) # Red
Wait Function
Instead of using time.sleep(), you can use this function because this solves windows not responding error
screen.wait(0.5) # Seconds
Background Video
You can add video as background in your splash screen using this function.
video = splash.BackgroundVideo(screen,"exampleVid.mp4",fps=30,loop=True)
# loop = True/False : default(False) | fps = int : default(fps=30)
Play video
video.play()
Pause video
video.pause()
Resume video
video.resume()
Delete video
video.delete()
Transparency
Make your video transparent | Transparency Level is 0 to 255 (default: 120)
video.transparency(150)
Stop Transparency Using
video.stop_transparency()
Stopping / Resuming Video Loops
# Loop Video
video.loop = True
# Stop the Loop
video.stop_loop() # OR video.loop = False
To check whether the video is playing or stopped
# Returns True if playing else False
video.playing()
Background Image
You can add Image as background in your splash screen using this function.
bg_img = splash.BackgroundImage(screen,"YourImage.png")
bg_img.set()
Progress Bar
This function adds a progress bar
bar = splash.LoadingBar(screen) # Arguments : Parent , width , height
bar.place() # Arguments : x , y , colour , loading_colour OR Default
Hiding the Progress Bar
bar.hide()
Setting Progress
bar.set_progress(50)
Text
Adds text on the Screen
text = splash.Text(screen,"Loading...","impact",20,(325,400)) # Arguments : parent , text , font , size , position , colour
text.show()
Show and Hide text
# Show text using
text.show()
# Hide Text using
text.hide()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splashscreen_engine-1.0.2.tar.gz.
File metadata
- Download URL: splashscreen_engine-1.0.2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17375967fa90c1729f83324cdf236be674e4a9efd2e18872ba6b81e226566550
|
|
| MD5 |
4b015a5a73aa0cc00d60a7fc068d52af
|
|
| BLAKE2b-256 |
4e0b84db3ba3135f280cb296b20223d269650c6d30d8c739eda62a0187f96d5a
|
File details
Details for the file splashscreen_engine-1.0.2-py3-none-any.whl.
File metadata
- Download URL: splashscreen_engine-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f58b07e03195611ed7f252f26c13a1cef4278293c8a3d79c9f0a4e4b11ba52d0
|
|
| MD5 |
c2dbde85064166a1527b34471b421426
|
|
| BLAKE2b-256 |
4804f8ee3394bcf2328565880b4a23a240eea4ac2d0c4397a029be475ff60e08
|