splashscreen-engine 2.0.4__tar.gz → 2.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,36 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splashscreen-engine
3
- Version: 2.0.4
4
- Summary: A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for Applications.
3
+ Version: 2.0.6
4
+ Summary: A Python framework for creating splash screens with videos, images, animated loading bars, threaded rendering, transparency, and dynamic UI support.
5
5
  Home-page: https://github.com/NamanChhabra21/splashscreen-engine
6
6
  Author: Naman Chhabra
7
+ Author-email: chhabranaman21@gmail.com
7
8
  License: MIT
8
9
  Project-URL: Source, https://github.com/NamanChhabra21/splashscreen-engine
9
10
  Project-URL: Issues, https://github.com/NamanChhabra21/splashscreen-engine/issues
10
11
  Project-URL: Discussions, https://github.com/NamanChhabra21/splashscreen-engine/discussions
11
- Keywords: pygame,splash-screen,loading-screen,python,gui,video,splashscreen,pygame-gui,window,animation,loading,open-cv,naman,chhabra,splash,pypi,github,screen,how to,module,api,example,documentation,README,tkinter,customtkinter,opencv-python,code,2.0.4,player,tutorial
12
+ Project-URL: PyPI, https://pypi.org/project/splashscreen-engine/
13
+ Keywords: pygame,splash-screen,loading-screen,opencv,video-rendering,pygame-framework,python-gui,animation,desktop-app,threaded-rendering,video-loader,splashscreen,loading-bar,multimedia
12
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
13
20
  Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
21
+ Classifier: Operating System :: Microsoft :: Windows
15
22
  Classifier: Topic :: Software Development :: Libraries
16
- Classifier: Topic :: Multimedia :: Video
17
23
  Classifier: Topic :: Multimedia :: Graphics
24
+ Classifier: Topic :: Multimedia :: Video
25
+ Classifier: Topic :: Games/Entertainment
26
+ Classifier: Intended Audience :: Developers
18
27
  Requires-Python: >=3.8
19
28
  Description-Content-Type: text/markdown
20
29
  Requires-Dist: pygame
21
30
  Requires-Dist: opencv-python
22
31
  Requires-Dist: numpy
23
32
  Dynamic: author
33
+ Dynamic: author-email
24
34
  Dynamic: classifier
25
35
  Dynamic: description
26
36
  Dynamic: description-content-type
@@ -32,11 +42,49 @@ Dynamic: requires-dist
32
42
  Dynamic: requires-python
33
43
  Dynamic: summary
34
44
 
45
+ ![PyPI version](https://img.shields.io/pypi/v/splashscreen-engine)
46
+ ![Python](https://img.shields.io/pypi/pyversions/splashscreen-engine)
47
+ ![License](https://img.shields.io/github/license/NamanChhabra21/splashscreen-engine)
35
48
  # splashscreen-engine
36
49
  A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for your Applications.
37
-
38
50
  ## Sample Preview
39
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
51
+
52
+ You can find these template codes here:
53
+ [Templates](https://github.com/NamanChhabra21/splashscreen-engine/tree/main/Templates)
54
+
55
+ <table>
56
+ <tr>
57
+ <td align="center">
58
+
59
+ ### Template 1
60
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template0GIF.gif" width="350">
61
+
62
+ </td>
63
+
64
+ <td align="center">
65
+
66
+ ### Template 3
67
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template2GIF.gif" width="350">
68
+
69
+ </td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <td align="center">
74
+
75
+ ### Template 2
76
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template1GIF.gif" width="350">
77
+
78
+ </td>
79
+
80
+ <td align="center">
81
+
82
+ ### Template 4
83
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template3GIF.gif" width="350">
84
+
85
+ </td>
86
+ </tr>
87
+ </table>
40
88
 
41
89
  ## Features
42
90
 
@@ -45,7 +93,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
45
93
  - Fullscreen Support
46
94
  - Background videos
47
95
  - Background images
48
- - Loading bars
96
+ - Video-powered loading bars
49
97
  - Text rendering
50
98
  - Transparency support
51
99
  - Threaded rendering
@@ -57,96 +105,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
57
105
  ```bash
58
106
  pip install splashscreen-engine
59
107
  ```
60
- OR
61
- ```bash
62
- pip install splashscreen-engine==2.0.4
63
- ```
108
+ > [!NOTE]
109
+ > Windows is currently the primary supported platform.
64
110
 
65
- ## Example
111
+ ## Quick Start
66
112
 
67
113
  ```python
68
114
  import splashscreen_engine as splash
69
115
 
70
116
  screen = splash.Screen()
71
- screen.size(750,500)
72
117
 
73
- # This Starts The Engine
74
118
  screen.start()
75
119
 
76
- # Background Video
77
120
  video = splash.BackgroundVideo(
78
121
  screen,
79
- "exampleVid.mp4",
80
- fps=30,
81
- loop=True
122
+ "video.mp4"
82
123
  )
83
124
 
84
125
  video.play()
85
126
 
86
- # Loading Bar
87
- bar = splash.LoadingBar(screen,add_xy=(0,100)) # By default, position is `center` and add 100 units to y-axis
88
- bar.place()
89
-
90
- # Text `loading`
91
- text = splash.Text(
92
- screen,
93
- "Loading...",
94
- "impact",
95
- 20,
96
- "down",
97
- add_xy=(0,-80) # Place the text downward and subtract 80 units from y-axis
98
- )
99
-
100
- text.show()
101
-
102
- # LOADING | you can add your `loading` processes here
103
-
104
- a = 0
105
-
106
- while not a >= 100:
107
-
108
- a += 0.3
109
-
110
- text.edit(
111
- text=f"loading : {round(a,2)}%"
112
- )
113
-
114
- bar.set_progress(a)
115
-
116
- screen.wait(0.05)
117
-
118
- text.edit(
119
- text="loaded : 100%"
120
- )
127
+ screen.wait(5)
121
128
 
122
- screen.wait(3)
123
-
124
- # Stop the splash screen after loading
125
129
  screen.stop()
126
130
 
127
-
128
- """
129
- if you are using pygame module in your own code,
130
- use `screen.stop(quit_pygame=False)`
131
- instead of `screen.stop()`
132
- """
133
-
134
- # Main Screen Example
135
-
136
- import tkinter # Used as main screen for example.
137
- main_screen = tkinter.Tk()
138
-
139
- main_screen.geometry("750x500")
140
-
141
- main_text = tkinter.Label(
142
- main_screen,
143
- text="Your Main Screen",
144
- font=("impact",40)
145
- )
146
-
147
- main_text.pack()
148
-
149
- main_screen.mainloop()
150
131
  ```
151
132
 
152
133
  ---
@@ -221,14 +202,13 @@ A title bar is the top bar of a window.
221
202
  It usually contains:
222
203
 
223
204
  - window title
224
- - window icon # Coming Soon
225
205
  - close button
226
206
  - minimize button
227
207
  - maximize button
228
208
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
229
209
 
230
210
  ---
231
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
211
+ ![Preview](Screenshots/screenshot2.png)
232
212
  ---
233
213
  #### To create a Title Bar
234
214
  ```python
@@ -383,6 +363,24 @@ bar.place()
383
363
  # Arguments:
384
364
  # colour, loading_colour
385
365
  ```
366
+ #### Video Loading Bar
367
+
368
+ You can use videos inside the loading area of the progress bar.
369
+
370
+ ```python
371
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
372
+ video_bar.set_video("Examplevideos/BarVid.mp4")
373
+
374
+ video_bar.place()
375
+ ```
376
+
377
+ The video automatically fills according to:
378
+
379
+ ```python
380
+ video_bar.set_progress(value)
381
+ ```
382
+
383
+ This creates animated loading effects inside the progress bar.
386
384
 
387
385
  #### Available Positions
388
386
 
@@ -502,6 +500,10 @@ text = splash.Text(
502
500
  )
503
501
  ```
504
502
 
503
+ This places the text:
504
+ - Horizontally centered
505
+ - 100 pixels above the center
506
+
505
507
  ---
506
508
  ### Getting Documentation
507
509
  ```python
@@ -530,3 +532,7 @@ chhabranaman21@gmail.com
530
532
  https://pypi.org/project/splashscreen-engine
531
533
 
532
534
  ---
535
+ ## Keywords
536
+
537
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
538
+ ---
@@ -1,8 +1,46 @@
1
+ ![PyPI version](https://img.shields.io/pypi/v/splashscreen-engine)
2
+ ![Python](https://img.shields.io/pypi/pyversions/splashscreen-engine)
3
+ ![License](https://img.shields.io/github/license/NamanChhabra21/splashscreen-engine)
1
4
  # splashscreen-engine
2
5
  A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for your Applications.
3
-
4
6
  ## Sample Preview
5
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
7
+
8
+ You can find these template codes here:
9
+ [Templates](https://github.com/NamanChhabra21/splashscreen-engine/tree/main/Templates)
10
+
11
+ <table>
12
+ <tr>
13
+ <td align="center">
14
+
15
+ ### Template 1
16
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template0GIF.gif" width="350">
17
+
18
+ </td>
19
+
20
+ <td align="center">
21
+
22
+ ### Template 3
23
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template2GIF.gif" width="350">
24
+
25
+ </td>
26
+ </tr>
27
+
28
+ <tr>
29
+ <td align="center">
30
+
31
+ ### Template 2
32
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template1GIF.gif" width="350">
33
+
34
+ </td>
35
+
36
+ <td align="center">
37
+
38
+ ### Template 4
39
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template3GIF.gif" width="350">
40
+
41
+ </td>
42
+ </tr>
43
+ </table>
6
44
 
7
45
  ## Features
8
46
 
@@ -11,7 +49,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
11
49
  - Fullscreen Support
12
50
  - Background videos
13
51
  - Background images
14
- - Loading bars
52
+ - Video-powered loading bars
15
53
  - Text rendering
16
54
  - Transparency support
17
55
  - Threaded rendering
@@ -23,96 +61,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
23
61
  ```bash
24
62
  pip install splashscreen-engine
25
63
  ```
26
- OR
27
- ```bash
28
- pip install splashscreen-engine==2.0.4
29
- ```
64
+ > [!NOTE]
65
+ > Windows is currently the primary supported platform.
30
66
 
31
- ## Example
67
+ ## Quick Start
32
68
 
33
69
  ```python
34
70
  import splashscreen_engine as splash
35
71
 
36
72
  screen = splash.Screen()
37
- screen.size(750,500)
38
73
 
39
- # This Starts The Engine
40
74
  screen.start()
41
75
 
42
- # Background Video
43
76
  video = splash.BackgroundVideo(
44
77
  screen,
45
- "exampleVid.mp4",
46
- fps=30,
47
- loop=True
78
+ "video.mp4"
48
79
  )
49
80
 
50
81
  video.play()
51
82
 
52
- # Loading Bar
53
- bar = splash.LoadingBar(screen,add_xy=(0,100)) # By default, position is `center` and add 100 units to y-axis
54
- bar.place()
55
-
56
- # Text `loading`
57
- text = splash.Text(
58
- screen,
59
- "Loading...",
60
- "impact",
61
- 20,
62
- "down",
63
- add_xy=(0,-80) # Place the text downward and subtract 80 units from y-axis
64
- )
65
-
66
- text.show()
67
-
68
- # LOADING | you can add your `loading` processes here
83
+ screen.wait(5)
69
84
 
70
- a = 0
71
-
72
- while not a >= 100:
73
-
74
- a += 0.3
75
-
76
- text.edit(
77
- text=f"loading : {round(a,2)}%"
78
- )
79
-
80
- bar.set_progress(a)
81
-
82
- screen.wait(0.05)
83
-
84
- text.edit(
85
- text="loaded : 100%"
86
- )
87
-
88
- screen.wait(3)
89
-
90
- # Stop the splash screen after loading
91
85
  screen.stop()
92
86
 
93
-
94
- """
95
- if you are using pygame module in your own code,
96
- use `screen.stop(quit_pygame=False)`
97
- instead of `screen.stop()`
98
- """
99
-
100
- # Main Screen Example
101
-
102
- import tkinter # Used as main screen for example.
103
- main_screen = tkinter.Tk()
104
-
105
- main_screen.geometry("750x500")
106
-
107
- main_text = tkinter.Label(
108
- main_screen,
109
- text="Your Main Screen",
110
- font=("impact",40)
111
- )
112
-
113
- main_text.pack()
114
-
115
- main_screen.mainloop()
116
87
  ```
117
88
 
118
89
  ---
@@ -187,14 +158,13 @@ A title bar is the top bar of a window.
187
158
  It usually contains:
188
159
 
189
160
  - window title
190
- - window icon # Coming Soon
191
161
  - close button
192
162
  - minimize button
193
163
  - maximize button
194
164
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
195
165
 
196
166
  ---
197
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
167
+ ![Preview](Screenshots/screenshot2.png)
198
168
  ---
199
169
  #### To create a Title Bar
200
170
  ```python
@@ -349,6 +319,24 @@ bar.place()
349
319
  # Arguments:
350
320
  # colour, loading_colour
351
321
  ```
322
+ #### Video Loading Bar
323
+
324
+ You can use videos inside the loading area of the progress bar.
325
+
326
+ ```python
327
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
328
+ video_bar.set_video("Examplevideos/BarVid.mp4")
329
+
330
+ video_bar.place()
331
+ ```
332
+
333
+ The video automatically fills according to:
334
+
335
+ ```python
336
+ video_bar.set_progress(value)
337
+ ```
338
+
339
+ This creates animated loading effects inside the progress bar.
352
340
 
353
341
  #### Available Positions
354
342
 
@@ -468,6 +456,10 @@ text = splash.Text(
468
456
  )
469
457
  ```
470
458
 
459
+ This places the text:
460
+ - Horizontally centered
461
+ - 100 pixels above the center
462
+
471
463
  ---
472
464
  ### Getting Documentation
473
465
  ```python
@@ -496,3 +488,7 @@ chhabranaman21@gmail.com
496
488
  https://pypi.org/project/splashscreen-engine
497
489
 
498
490
  ---
491
+ ## Keywords
492
+
493
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
494
+ ---
@@ -6,9 +6,12 @@ with open("README.md", "r", encoding="utf-8") as f:
6
6
  setup(
7
7
  name="splashscreen-engine",
8
8
 
9
- version="2.0.4",
9
+ version="2.0.6",
10
10
 
11
- py_modules=["splashscreen_engine"],
11
+ py_modules=[
12
+ "splashscreen_engine",
13
+ "video_renderer"
14
+ ],
12
15
 
13
16
  install_requires=[
14
17
  "pygame",
@@ -18,9 +21,15 @@ setup(
18
21
 
19
22
  author="Naman Chhabra",
20
23
 
24
+ author_email="chhabranaman21@gmail.com",
25
+
21
26
  license="MIT",
22
27
 
23
- description="A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for Applications.",
28
+ description=(
29
+ "A Python framework for creating splash screens "
30
+ "with videos, images, animated loading bars, "
31
+ "threaded rendering, transparency, and dynamic UI support."
32
+ ),
24
33
 
25
34
  long_description=long_description,
26
35
 
@@ -32,51 +41,46 @@ setup(
32
41
  "Source": "https://github.com/NamanChhabra21/splashscreen-engine",
33
42
  "Issues": "https://github.com/NamanChhabra21/splashscreen-engine/issues",
34
43
  "Discussions": "https://github.com/NamanChhabra21/splashscreen-engine/discussions",
44
+ "PyPI": "https://pypi.org/project/splashscreen-engine/",
35
45
  },
36
46
 
37
47
  keywords=[
38
48
  "pygame",
39
49
  "splash-screen",
40
50
  "loading-screen",
41
- "python",
42
- "gui",
43
- "video",
44
- "splashscreen",
45
- "pygame-gui",
46
- "window",
51
+ "opencv",
52
+ "video-rendering",
53
+ "pygame-framework",
54
+ "python-gui",
47
55
  "animation",
48
- "loading",
49
- "open-cv",
50
- "naman",
51
- "chhabra",
52
- "splash",
53
- "pypi",
54
- "github",
55
- "screen",
56
- "how to",
57
- "module",
58
- "api",
59
- "example",
60
- "documentation",
61
- "README",
62
- "tkinter",
63
- "customtkinter",
64
- "opencv-python",
65
- "code",
66
- "2.0.4",
67
- "player",
68
- "tutorial"
69
-
56
+ "desktop-app",
57
+ "threaded-rendering",
58
+ "video-loader",
59
+ "splashscreen",
60
+ "loading-bar",
61
+ "multimedia"
70
62
  ],
71
63
 
72
64
  classifiers=[
73
65
  "Programming Language :: Python :: 3",
66
+ "Programming Language :: Python :: 3.8",
67
+ "Programming Language :: Python :: 3.9",
68
+ "Programming Language :: Python :: 3.10",
69
+ "Programming Language :: Python :: 3.11",
70
+ "Programming Language :: Python :: 3.12",
71
+
74
72
  "License :: OSI Approved :: MIT License",
75
- "Operating System :: OS Independent",
73
+
74
+ "Operating System :: Microsoft :: Windows",
75
+
76
76
  "Topic :: Software Development :: Libraries",
77
- "Topic :: Multimedia :: Video",
78
77
  "Topic :: Multimedia :: Graphics",
78
+ "Topic :: Multimedia :: Video",
79
+ "Topic :: Games/Entertainment",
80
+
81
+ "Intended Audience :: Developers"
79
82
  ],
80
83
 
81
84
  python_requires=">=3.8",
82
- )
85
+ )
86
+
@@ -1,26 +1,36 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splashscreen-engine
3
- Version: 2.0.4
4
- Summary: A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for Applications.
3
+ Version: 2.0.6
4
+ Summary: A Python framework for creating splash screens with videos, images, animated loading bars, threaded rendering, transparency, and dynamic UI support.
5
5
  Home-page: https://github.com/NamanChhabra21/splashscreen-engine
6
6
  Author: Naman Chhabra
7
+ Author-email: chhabranaman21@gmail.com
7
8
  License: MIT
8
9
  Project-URL: Source, https://github.com/NamanChhabra21/splashscreen-engine
9
10
  Project-URL: Issues, https://github.com/NamanChhabra21/splashscreen-engine/issues
10
11
  Project-URL: Discussions, https://github.com/NamanChhabra21/splashscreen-engine/discussions
11
- Keywords: pygame,splash-screen,loading-screen,python,gui,video,splashscreen,pygame-gui,window,animation,loading,open-cv,naman,chhabra,splash,pypi,github,screen,how to,module,api,example,documentation,README,tkinter,customtkinter,opencv-python,code,2.0.4,player,tutorial
12
+ Project-URL: PyPI, https://pypi.org/project/splashscreen-engine/
13
+ Keywords: pygame,splash-screen,loading-screen,opencv,video-rendering,pygame-framework,python-gui,animation,desktop-app,threaded-rendering,video-loader,splashscreen,loading-bar,multimedia
12
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
13
20
  Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
21
+ Classifier: Operating System :: Microsoft :: Windows
15
22
  Classifier: Topic :: Software Development :: Libraries
16
- Classifier: Topic :: Multimedia :: Video
17
23
  Classifier: Topic :: Multimedia :: Graphics
24
+ Classifier: Topic :: Multimedia :: Video
25
+ Classifier: Topic :: Games/Entertainment
26
+ Classifier: Intended Audience :: Developers
18
27
  Requires-Python: >=3.8
19
28
  Description-Content-Type: text/markdown
20
29
  Requires-Dist: pygame
21
30
  Requires-Dist: opencv-python
22
31
  Requires-Dist: numpy
23
32
  Dynamic: author
33
+ Dynamic: author-email
24
34
  Dynamic: classifier
25
35
  Dynamic: description
26
36
  Dynamic: description-content-type
@@ -32,11 +42,49 @@ Dynamic: requires-dist
32
42
  Dynamic: requires-python
33
43
  Dynamic: summary
34
44
 
45
+ ![PyPI version](https://img.shields.io/pypi/v/splashscreen-engine)
46
+ ![Python](https://img.shields.io/pypi/pyversions/splashscreen-engine)
47
+ ![License](https://img.shields.io/github/license/NamanChhabra21/splashscreen-engine)
35
48
  # splashscreen-engine
36
49
  A module for making Splash Screens with videos, images, loading bars, text rendering, and threaded rendering support for your Applications.
37
-
38
50
  ## Sample Preview
39
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
51
+
52
+ You can find these template codes here:
53
+ [Templates](https://github.com/NamanChhabra21/splashscreen-engine/tree/main/Templates)
54
+
55
+ <table>
56
+ <tr>
57
+ <td align="center">
58
+
59
+ ### Template 1
60
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template0GIF.gif" width="350">
61
+
62
+ </td>
63
+
64
+ <td align="center">
65
+
66
+ ### Template 3
67
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template2GIF.gif" width="350">
68
+
69
+ </td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <td align="center">
74
+
75
+ ### Template 2
76
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template1GIF.gif" width="350">
77
+
78
+ </td>
79
+
80
+ <td align="center">
81
+
82
+ ### Template 4
83
+ <img src="https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/Template3GIF.gif" width="350">
84
+
85
+ </td>
86
+ </tr>
87
+ </table>
40
88
 
41
89
  ## Features
42
90
 
@@ -45,7 +93,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
45
93
  - Fullscreen Support
46
94
  - Background videos
47
95
  - Background images
48
- - Loading bars
96
+ - Video-powered loading bars
49
97
  - Text rendering
50
98
  - Transparency support
51
99
  - Threaded rendering
@@ -57,96 +105,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
57
105
  ```bash
58
106
  pip install splashscreen-engine
59
107
  ```
60
- OR
61
- ```bash
62
- pip install splashscreen-engine==2.0.4
63
- ```
108
+ > [!NOTE]
109
+ > Windows is currently the primary supported platform.
64
110
 
65
- ## Example
111
+ ## Quick Start
66
112
 
67
113
  ```python
68
114
  import splashscreen_engine as splash
69
115
 
70
116
  screen = splash.Screen()
71
- screen.size(750,500)
72
117
 
73
- # This Starts The Engine
74
118
  screen.start()
75
119
 
76
- # Background Video
77
120
  video = splash.BackgroundVideo(
78
121
  screen,
79
- "exampleVid.mp4",
80
- fps=30,
81
- loop=True
122
+ "video.mp4"
82
123
  )
83
124
 
84
125
  video.play()
85
126
 
86
- # Loading Bar
87
- bar = splash.LoadingBar(screen,add_xy=(0,100)) # By default, position is `center` and add 100 units to y-axis
88
- bar.place()
89
-
90
- # Text `loading`
91
- text = splash.Text(
92
- screen,
93
- "Loading...",
94
- "impact",
95
- 20,
96
- "down",
97
- add_xy=(0,-80) # Place the text downward and subtract 80 units from y-axis
98
- )
99
-
100
- text.show()
101
-
102
- # LOADING | you can add your `loading` processes here
103
-
104
- a = 0
105
-
106
- while not a >= 100:
107
-
108
- a += 0.3
109
-
110
- text.edit(
111
- text=f"loading : {round(a,2)}%"
112
- )
113
-
114
- bar.set_progress(a)
115
-
116
- screen.wait(0.05)
117
-
118
- text.edit(
119
- text="loaded : 100%"
120
- )
127
+ screen.wait(5)
121
128
 
122
- screen.wait(3)
123
-
124
- # Stop the splash screen after loading
125
129
  screen.stop()
126
130
 
127
-
128
- """
129
- if you are using pygame module in your own code,
130
- use `screen.stop(quit_pygame=False)`
131
- instead of `screen.stop()`
132
- """
133
-
134
- # Main Screen Example
135
-
136
- import tkinter # Used as main screen for example.
137
- main_screen = tkinter.Tk()
138
-
139
- main_screen.geometry("750x500")
140
-
141
- main_text = tkinter.Label(
142
- main_screen,
143
- text="Your Main Screen",
144
- font=("impact",40)
145
- )
146
-
147
- main_text.pack()
148
-
149
- main_screen.mainloop()
150
131
  ```
151
132
 
152
133
  ---
@@ -221,14 +202,13 @@ A title bar is the top bar of a window.
221
202
  It usually contains:
222
203
 
223
204
  - window title
224
- - window icon # Coming Soon
225
205
  - close button
226
206
  - minimize button
227
207
  - maximize button
228
208
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
229
209
 
230
210
  ---
231
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
211
+ ![Preview](Screenshots/screenshot2.png)
232
212
  ---
233
213
  #### To create a Title Bar
234
214
  ```python
@@ -383,6 +363,24 @@ bar.place()
383
363
  # Arguments:
384
364
  # colour, loading_colour
385
365
  ```
366
+ #### Video Loading Bar
367
+
368
+ You can use videos inside the loading area of the progress bar.
369
+
370
+ ```python
371
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
372
+ video_bar.set_video("Examplevideos/BarVid.mp4")
373
+
374
+ video_bar.place()
375
+ ```
376
+
377
+ The video automatically fills according to:
378
+
379
+ ```python
380
+ video_bar.set_progress(value)
381
+ ```
382
+
383
+ This creates animated loading effects inside the progress bar.
386
384
 
387
385
  #### Available Positions
388
386
 
@@ -502,6 +500,10 @@ text = splash.Text(
502
500
  )
503
501
  ```
504
502
 
503
+ This places the text:
504
+ - Horizontally centered
505
+ - 100 pixels above the center
506
+
505
507
  ---
506
508
  ### Getting Documentation
507
509
  ```python
@@ -530,3 +532,7 @@ chhabranaman21@gmail.com
530
532
  https://pypi.org/project/splashscreen-engine
531
533
 
532
534
  ---
535
+ ## Keywords
536
+
537
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
538
+ ---
@@ -1,6 +1,7 @@
1
1
  README.md
2
2
  setup.py
3
3
  splashscreen_engine.py
4
+ video_renderer.py
4
5
  splashscreen_engine.egg-info/PKG-INFO
5
6
  splashscreen_engine.egg-info/SOURCES.txt
6
7
  splashscreen_engine.egg-info/dependency_links.txt
@@ -3,13 +3,17 @@ import threading
3
3
  import time
4
4
 
5
5
 
6
+
7
+ # Hide pygame Welcome Message and centralize the screen
6
8
  os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
7
9
  s = '1'
8
10
  os.environ['SDL_VIDEO_CENTERED'] = s
9
11
 
10
12
  # Modules
11
13
  import pygame
12
- import cv2
14
+
15
+ # Engine Files
16
+ import video_renderer
13
17
 
14
18
 
15
19
  deleted_by_user = False
@@ -63,19 +67,71 @@ def draw_loading_bar(screen, bars):
63
67
  )
64
68
 
65
69
  # INNER LOADER
66
- pygame.draw.rect(
67
- screen,
68
- bar.loading_colour,
69
- (x,y,
70
- int(
71
- bar.width *
72
- (bar.progress / 100)
70
+ if bar.video is None: # Fill Color
71
+
72
+ pygame.draw.rect(
73
+ screen,
74
+ bar.loading_colour,
75
+ (
76
+ x,
77
+ y,
78
+ int(bar.width * (bar.progress / 100)),
79
+ int(bar.height)
73
80
  ),
81
+ border_radius=10
82
+ )
83
+ continue
84
+
85
+ # For Inner Bar Video
86
+ surface = bar.video.next_frame(
87
+ int(bar.width),
88
+ int(bar.height)
89
+ )
90
+
91
+ # If video ended
92
+ if surface is None:
93
+ bar.video.reset_frames()
94
+
95
+ surface = bar.video.next_frame(
96
+ int(bar.width),
74
97
  int(bar.height)
75
- ),
76
- border_radius=10
98
+ )
99
+
100
+ progress_width = int(
101
+ bar.width * (bar.progress / 100)
77
102
  )
78
103
 
104
+ # Ensure width is not 0
105
+ if progress_width > 0:
106
+ cropped_surface = surface.subsurface(
107
+ (
108
+ 0,
109
+ 0,
110
+ progress_width,
111
+ int(bar.height)
112
+ )
113
+ )
114
+
115
+ final_surface = pygame.Surface(
116
+ (
117
+ progress_width,
118
+ int(bar.height)
119
+ ),
120
+ pygame.SRCALPHA
121
+ )
122
+
123
+ pygame.draw.rect(
124
+ final_surface,
125
+ (255, 255, 255, 255),
126
+ (
127
+ 0,
128
+ 0,progress_width,int(bar.height)),border_radius=10)
129
+ final_surface.blit(
130
+ cropped_surface,
131
+ (0, 0),
132
+ special_flags=pygame.BLEND_RGBA_MIN
133
+ )
134
+ screen.blit(final_surface,(x, y))
79
135
 
80
136
  def draw_text(screen, texts):
81
137
  for txt in texts:
@@ -107,7 +163,7 @@ def draw_text(screen, texts):
107
163
  screen.blit(surface,text_rect)
108
164
 
109
165
 
110
- one_time_warning = True # A variable used for printing warning inside the size() function | Ensuring doesn't repeat printing the same
166
+
111
167
 
112
168
  class Screen:
113
169
 
@@ -165,7 +221,7 @@ class Screen:
165
221
  self.title_bar = title_bar
166
222
  self.is_escape = False
167
223
 
168
-
224
+ self.one_time_warning = True # A variable used for printing warning inside the size() function | Ensuring doesn't repeat printing the same
169
225
 
170
226
 
171
227
 
@@ -225,6 +281,7 @@ class Screen:
225
281
  if event.type == pygame.QUIT:
226
282
 
227
283
  program_stopped = True
284
+ self.running = False
228
285
  if event.type == pygame.KEYDOWN:
229
286
  if event.key == pygame.K_ESCAPE:
230
287
  self.is_escape = True
@@ -234,6 +291,7 @@ class Screen:
234
291
  for event in pygame.event.get():
235
292
  if event.type == pygame.QUIT:
236
293
  program_stopped = True
294
+ self.running = False
237
295
 
238
296
 
239
297
 
@@ -242,7 +300,8 @@ class Screen:
242
300
 
243
301
  # DRAW BACKGROUND IMAGE
244
302
  if self.current_background:
245
- self.screen.blit(self.current_background.image,(0, 0))
303
+ bg = pygame.transform.scale(self.current_background.original_image,(self.width,self.height))
304
+ self.screen.blit(bg,(0, 0))
246
305
  draw_loading_bar(self.screen,self.current_background.ui_elements)
247
306
  draw_text(self.screen,self.current_background.ui_elements)
248
307
 
@@ -250,7 +309,7 @@ class Screen:
250
309
  if self.foreground_video:
251
310
 
252
311
  # DRAW VIDEO FRAME
253
- if self.foreground_video.frame:
312
+ if self.foreground_video.frame is not None:
254
313
  self.screen.blit(self.foreground_video.frame,(0, 0))
255
314
 
256
315
  # DRAW VIDEO UI
@@ -300,8 +359,8 @@ class Screen:
300
359
  f"Width and Height must be positive integers. Got width = {width} and height = {height}."
301
360
  )
302
361
 
303
- global one_time_warning
304
- if self.running and one_time_warning:
362
+
363
+ if self.running and self.one_time_warning:
305
364
  print(
306
365
  "\033[93m"
307
366
  "[WARNING]\n"
@@ -313,7 +372,7 @@ class Screen:
313
372
  "window resizing is intended."
314
373
  "\033[0m"
315
374
  )
316
- one_time_warning = False
375
+ self.one_time_warning = False
317
376
 
318
377
  self.fullscreen = fullscreen
319
378
 
@@ -349,7 +408,7 @@ class Screen:
349
408
 
350
409
  return
351
410
 
352
- while seconds >= 0:
411
+ while seconds > 0:
353
412
 
354
413
  avoid_lag()
355
414
 
@@ -398,7 +457,7 @@ class BackgroundVideo:
398
457
 
399
458
  self.path = path
400
459
 
401
- self.video = cv2.VideoCapture(self.path)
460
+ self.video = video_renderer.Vid(self.path)
402
461
 
403
462
  self.stop = False
404
463
 
@@ -420,6 +479,8 @@ class BackgroundVideo:
420
479
 
421
480
  self.loop = loop
422
481
 
482
+ self.clock = pygame.time.Clock()
483
+
423
484
  def play(self):
424
485
 
425
486
  self.stop = False
@@ -432,26 +493,30 @@ class BackgroundVideo:
432
493
  if not self.video:
433
494
  return
434
495
 
496
+
435
497
  def thread_video():
436
498
 
437
499
  while self.parent.running and not self.stop:
438
500
 
439
501
  avoid_lag()
440
502
 
441
- # READ FRAME
442
- success, frame = self.video.read()
503
+ # get Video Frame
504
+
505
+ # FULLSCREEN
506
+ if self.parent.fullscreen:
507
+
508
+ surface = self.video.next_frame(self.parent.info.current_w, self.parent.info.current_h)
509
+
510
+ # NORMAL WINDOW
511
+ else:
512
+ surface = self.video.next_frame(self.parent.width, self.parent.height)
443
513
 
444
514
  # VIDEO FINISHED
445
- if not success:
515
+ if surface is None:
446
516
 
447
517
  # LOOP VIDEO
448
518
  if self.loop:
449
-
450
- self.video.set(
451
- cv2.CAP_PROP_POS_FRAMES,
452
- 0
453
- )
454
-
519
+ self.video.reset_frames()
455
520
  continue
456
521
 
457
522
  # NORMAL VIDEO END
@@ -461,58 +526,18 @@ class BackgroundVideo:
461
526
 
462
527
  # REMOVE FRAME ONLY
463
528
  self.frame = None
464
-
465
529
  break
466
530
 
467
- # CONVERT COLORS
468
- frame = cv2.cvtColor(
469
- frame,
470
- cv2.COLOR_BGR2RGB
471
- )
472
-
473
- # FULLSCREEN
474
- if self.parent.fullscreen:
475
-
476
- frame = cv2.resize(
477
- frame,
478
- (
479
- self.parent.info.current_w,
480
- self.parent.info.current_h
481
- )
482
- )
483
-
484
- # NORMAL WINDOW
485
- else:
486
-
487
- frame = cv2.resize(
488
- frame,
489
- (
490
- self.parent.width,
491
- self.parent.height
492
- )
493
- )
494
-
495
- # CREATE SURFACE
496
- surface = pygame.surfarray.make_surface(
497
- frame.swapaxes(0, 1)
498
- )
499
531
 
500
532
  # TRANSPARENCY
501
533
  if self.transparent:
502
-
503
- surface.set_alpha(
504
- self.transparent_level
505
- )
534
+ surface.set_alpha(self.transparent_level)
506
535
 
507
536
  # STORE FRAME
508
537
  self.frame = surface
538
+ self.clock.tick(self.fps)
509
539
 
510
- self.parent.clock.tick(self.fps)
511
-
512
- self.loop_thread_video = threading.Thread(
513
- target=thread_video
514
- )
515
-
540
+ self.loop_thread_video = threading.Thread(target=thread_video)
516
541
  self.loop_thread_video.start()
517
542
 
518
543
  def pause(self):
@@ -523,19 +548,17 @@ class BackgroundVideo:
523
548
 
524
549
  def resume(self):
525
550
 
526
- self.stop = False
551
+ if self.stop:
552
+ self.stop = False
553
+
554
+ self.play()
527
555
 
528
- self.play()
529
556
 
530
557
  def delete(self):
531
558
 
532
559
  self.pause()
533
560
 
534
- self.video.set(
535
- cv2.CAP_PROP_POS_FRAMES,
536
- 0
537
- )
538
-
561
+ self.video.reset_frames()
539
562
  self.frame = None
540
563
 
541
564
  def transparency(self, level=120):
@@ -558,7 +581,7 @@ class BackgroundVideo:
558
581
  self.loop = False
559
582
 
560
583
  def playing(self):
561
- return self.playing
584
+ return self.is_playing
562
585
 
563
586
 
564
587
  class BackgroundImage:
@@ -578,34 +601,10 @@ class BackgroundImage:
578
601
 
579
602
  self.ui_elements = []
580
603
 
581
- image = pygame.image.load(self.path)
582
-
583
- # FULLSCREEN
584
- if self.parent.fullscreen:
585
-
586
- image = pygame.transform.scale(
587
- image,
588
- (
589
- self.parent.info.current_w,
590
- self.parent.info.current_h
591
- )
592
- )
593
-
594
- # NORMAL WINDOW
595
- else:
596
-
597
- image = pygame.transform.scale(
598
- image,
599
- (
600
- self.parent.width,
601
- self.parent.height
602
- )
603
- )
604
-
605
- self.image = image
604
+ self.original_image = pygame.image.load(self.path).convert_alpha()
605
+ self.image = self.original_image
606
606
 
607
607
  def set(self):
608
-
609
608
  self.parent.current_background = self
610
609
 
611
610
 
@@ -657,6 +656,9 @@ class LoadingBar:
657
656
 
658
657
  self.progress = 0
659
658
 
659
+ self.video = None
660
+ self.video_frame = None
661
+
660
662
  def place(
661
663
  self,
662
664
  colour=(255, 255, 255),
@@ -684,6 +686,10 @@ class LoadingBar:
684
686
 
685
687
  self.progress = value
686
688
 
689
+ def set_video(self,path):
690
+ self.video = video_renderer.Vid(path)
691
+
692
+
687
693
  def check_valid_pos(string,object_type):
688
694
  available_position = ["right", "left", "down", "up", "center",None]
689
695
  if string not in available_position:
@@ -703,11 +709,10 @@ class Text:
703
709
  self.text = text
704
710
  self.font = font
705
711
  self.size = size
706
- self.position = position
707
712
  self.colour = colour
708
713
  # DEFAULT FONT
709
714
  self.pg_font = pygame.font.SysFont(self.font,self.size)
710
- self.visible = True
715
+ self.visible = False
711
716
 
712
717
 
713
718
 
@@ -727,9 +732,10 @@ class Text:
727
732
 
728
733
  if new_size is not None:
729
734
  self.size = new_size
735
+ self.pg_font = pygame.font.SysFont(self.font, self.size)
730
736
 
731
737
  if position is not None:
732
- self.position = position
738
+ self.position = position.lower()
733
739
 
734
740
  if add_xy is not None:
735
741
  self.add_xy = add_xy
@@ -0,0 +1,38 @@
1
+ import cv2
2
+ import pygame
3
+
4
+ class Vid:
5
+
6
+ def __init__(self,video_path):
7
+
8
+ self.path = video_path
9
+ self.ret = None
10
+ self.frame = None
11
+ self.video = cv2.VideoCapture(video_path)
12
+
13
+ def next_frame(self,width,height):
14
+
15
+ # Reading Next Frame
16
+ self.ret,self.frame =self.video.read()
17
+
18
+ # Check if next frame exists
19
+ if not self.ret:
20
+ return None
21
+ # Resizing the Frame
22
+ self.frame = cv2.resize(self.frame,(width,height))
23
+
24
+ # Converting BGR to RGB ( pygame supports RGB )
25
+ self.frame = cv2.cvtColor(self.frame,cv2.COLOR_BGR2RGB)
26
+
27
+ # Swapping dimensions for pygame
28
+ self.frame = self.frame.swapaxes(0,1)
29
+
30
+ # Make pygame Surface
31
+ surface = pygame.surfarray.make_surface(self.frame)
32
+
33
+ # Return pygame Surface
34
+ return surface
35
+
36
+ def reset_frames(self):
37
+ self.video.set(cv2.CAP_PROP_POS_FRAMES,0)
38
+