splashscreen-engine 2.0.4__tar.gz → 2.0.5__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.5
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,17 @@ 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
50
 
38
51
  ## Sample Preview
39
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
52
+ #### Template 1
53
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot.png)
54
+ #### Template 2
55
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot3.png)
40
56
 
41
57
  ## Features
42
58
 
@@ -45,7 +61,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
45
61
  - Fullscreen Support
46
62
  - Background videos
47
63
  - Background images
48
- - Loading bars
64
+ - Video-powered loading bars
49
65
  - Text rendering
50
66
  - Transparency support
51
67
  - Threaded rendering
@@ -57,96 +73,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
57
73
  ```bash
58
74
  pip install splashscreen-engine
59
75
  ```
60
- OR
61
- ```bash
62
- pip install splashscreen-engine==2.0.4
63
- ```
76
+ > [!NOTE]
77
+ > Windows is currently the primary supported platform.
64
78
 
65
- ## Example
79
+ ## Quick Start
66
80
 
67
81
  ```python
68
82
  import splashscreen_engine as splash
69
83
 
70
84
  screen = splash.Screen()
71
- screen.size(750,500)
72
85
 
73
- # This Starts The Engine
74
86
  screen.start()
75
87
 
76
- # Background Video
77
88
  video = splash.BackgroundVideo(
78
89
  screen,
79
- "exampleVid.mp4",
80
- fps=30,
81
- loop=True
90
+ "video.mp4"
82
91
  )
83
92
 
84
93
  video.play()
85
94
 
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)
95
+ screen.wait(5)
117
96
 
118
- text.edit(
119
- text="loaded : 100%"
120
- )
121
-
122
- screen.wait(3)
123
-
124
- # Stop the splash screen after loading
125
97
  screen.stop()
126
98
 
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
99
  ```
151
100
 
152
101
  ---
@@ -221,14 +170,13 @@ A title bar is the top bar of a window.
221
170
  It usually contains:
222
171
 
223
172
  - window title
224
- - window icon # Coming Soon
225
173
  - close button
226
174
  - minimize button
227
175
  - maximize button
228
176
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
229
177
 
230
178
  ---
231
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
179
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot2.png)
232
180
  ---
233
181
  #### To create a Title Bar
234
182
  ```python
@@ -383,6 +331,24 @@ bar.place()
383
331
  # Arguments:
384
332
  # colour, loading_colour
385
333
  ```
334
+ #### Video Loading Bar
335
+
336
+ You can use videos inside the loading area of the progress bar.
337
+
338
+ ```python
339
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
340
+ video_bar.set_video("Examplevideos/BarVid.mp4")
341
+
342
+ video_bar.place()
343
+ ```
344
+
345
+ The video automatically fills according to:
346
+
347
+ ```python
348
+ video_bar.set_progress(value)
349
+ ```
350
+
351
+ This creates animated loading effects inside the progress bar.
386
352
 
387
353
  #### Available Positions
388
354
 
@@ -502,6 +468,10 @@ text = splash.Text(
502
468
  )
503
469
  ```
504
470
 
471
+ This places the text:
472
+ - Horizontally centered
473
+ - 100 pixels above the center
474
+
505
475
  ---
506
476
  ### Getting Documentation
507
477
  ```python
@@ -530,3 +500,7 @@ chhabranaman21@gmail.com
530
500
  https://pypi.org/project/splashscreen-engine
531
501
 
532
502
  ---
503
+ ## Keywords
504
+
505
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
506
+ ---
@@ -1,8 +1,14 @@
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
6
 
4
7
  ## Sample Preview
5
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
8
+ #### Template 1
9
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot.png)
10
+ #### Template 2
11
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot3.png)
6
12
 
7
13
  ## Features
8
14
 
@@ -11,7 +17,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
11
17
  - Fullscreen Support
12
18
  - Background videos
13
19
  - Background images
14
- - Loading bars
20
+ - Video-powered loading bars
15
21
  - Text rendering
16
22
  - Transparency support
17
23
  - Threaded rendering
@@ -23,96 +29,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
23
29
  ```bash
24
30
  pip install splashscreen-engine
25
31
  ```
26
- OR
27
- ```bash
28
- pip install splashscreen-engine==2.0.4
29
- ```
32
+ > [!NOTE]
33
+ > Windows is currently the primary supported platform.
30
34
 
31
- ## Example
35
+ ## Quick Start
32
36
 
33
37
  ```python
34
38
  import splashscreen_engine as splash
35
39
 
36
40
  screen = splash.Screen()
37
- screen.size(750,500)
38
41
 
39
- # This Starts The Engine
40
42
  screen.start()
41
43
 
42
- # Background Video
43
44
  video = splash.BackgroundVideo(
44
45
  screen,
45
- "exampleVid.mp4",
46
- fps=30,
47
- loop=True
46
+ "video.mp4"
48
47
  )
49
48
 
50
49
  video.play()
51
50
 
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
69
-
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)
51
+ screen.wait(5)
89
52
 
90
- # Stop the splash screen after loading
91
53
  screen.stop()
92
54
 
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
55
  ```
117
56
 
118
57
  ---
@@ -187,14 +126,13 @@ A title bar is the top bar of a window.
187
126
  It usually contains:
188
127
 
189
128
  - window title
190
- - window icon # Coming Soon
191
129
  - close button
192
130
  - minimize button
193
131
  - maximize button
194
132
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
195
133
 
196
134
  ---
197
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
135
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot2.png)
198
136
  ---
199
137
  #### To create a Title Bar
200
138
  ```python
@@ -349,6 +287,24 @@ bar.place()
349
287
  # Arguments:
350
288
  # colour, loading_colour
351
289
  ```
290
+ #### Video Loading Bar
291
+
292
+ You can use videos inside the loading area of the progress bar.
293
+
294
+ ```python
295
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
296
+ video_bar.set_video("Examplevideos/BarVid.mp4")
297
+
298
+ video_bar.place()
299
+ ```
300
+
301
+ The video automatically fills according to:
302
+
303
+ ```python
304
+ video_bar.set_progress(value)
305
+ ```
306
+
307
+ This creates animated loading effects inside the progress bar.
352
308
 
353
309
  #### Available Positions
354
310
 
@@ -468,6 +424,10 @@ text = splash.Text(
468
424
  )
469
425
  ```
470
426
 
427
+ This places the text:
428
+ - Horizontally centered
429
+ - 100 pixels above the center
430
+
471
431
  ---
472
432
  ### Getting Documentation
473
433
  ```python
@@ -496,3 +456,7 @@ chhabranaman21@gmail.com
496
456
  https://pypi.org/project/splashscreen-engine
497
457
 
498
458
  ---
459
+ ## Keywords
460
+
461
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
462
+ ---
@@ -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.5",
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.5
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,17 @@ 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
50
 
38
51
  ## Sample Preview
39
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot.png)
52
+ #### Template 1
53
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot.png)
54
+ #### Template 2
55
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot3.png)
40
56
 
41
57
  ## Features
42
58
 
@@ -45,7 +61,7 @@ A module for making Splash Screens with videos, images, loading bars, text rende
45
61
  - Fullscreen Support
46
62
  - Background videos
47
63
  - Background images
48
- - Loading bars
64
+ - Video-powered loading bars
49
65
  - Text rendering
50
66
  - Transparency support
51
67
  - Threaded rendering
@@ -57,96 +73,29 @@ A module for making Splash Screens with videos, images, loading bars, text rende
57
73
  ```bash
58
74
  pip install splashscreen-engine
59
75
  ```
60
- OR
61
- ```bash
62
- pip install splashscreen-engine==2.0.4
63
- ```
76
+ > [!NOTE]
77
+ > Windows is currently the primary supported platform.
64
78
 
65
- ## Example
79
+ ## Quick Start
66
80
 
67
81
  ```python
68
82
  import splashscreen_engine as splash
69
83
 
70
84
  screen = splash.Screen()
71
- screen.size(750,500)
72
85
 
73
- # This Starts The Engine
74
86
  screen.start()
75
87
 
76
- # Background Video
77
88
  video = splash.BackgroundVideo(
78
89
  screen,
79
- "exampleVid.mp4",
80
- fps=30,
81
- loop=True
90
+ "video.mp4"
82
91
  )
83
92
 
84
93
  video.play()
85
94
 
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)
95
+ screen.wait(5)
117
96
 
118
- text.edit(
119
- text="loaded : 100%"
120
- )
121
-
122
- screen.wait(3)
123
-
124
- # Stop the splash screen after loading
125
97
  screen.stop()
126
98
 
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
99
  ```
151
100
 
152
101
  ---
@@ -221,14 +170,13 @@ A title bar is the top bar of a window.
221
170
  It usually contains:
222
171
 
223
172
  - window title
224
- - window icon # Coming Soon
225
173
  - close button
226
174
  - minimize button
227
175
  - maximize button
228
176
  - Note : Clicking on Maximize / Minimize button automatically resizes the screen
229
177
 
230
178
  ---
231
- ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/screenshot2.png)
179
+ ![Preview](https://raw.githubusercontent.com/NamanChhabra21/splashscreen-engine/main/Screenshots/screenshot2.png)
232
180
  ---
233
181
  #### To create a Title Bar
234
182
  ```python
@@ -383,6 +331,24 @@ bar.place()
383
331
  # Arguments:
384
332
  # colour, loading_colour
385
333
  ```
334
+ #### Video Loading Bar
335
+
336
+ You can use videos inside the loading area of the progress bar.
337
+
338
+ ```python
339
+ video_bar = splash.LoadingBar(screen,width=500,height=25)
340
+ video_bar.set_video("Examplevideos/BarVid.mp4")
341
+
342
+ video_bar.place()
343
+ ```
344
+
345
+ The video automatically fills according to:
346
+
347
+ ```python
348
+ video_bar.set_progress(value)
349
+ ```
350
+
351
+ This creates animated loading effects inside the progress bar.
386
352
 
387
353
  #### Available Positions
388
354
 
@@ -502,6 +468,10 @@ text = splash.Text(
502
468
  )
503
469
  ```
504
470
 
471
+ This places the text:
472
+ - Horizontally centered
473
+ - 100 pixels above the center
474
+
505
475
  ---
506
476
  ### Getting Documentation
507
477
  ```python
@@ -530,3 +500,7 @@ chhabranaman21@gmail.com
530
500
  https://pypi.org/project/splashscreen-engine
531
501
 
532
502
  ---
503
+ ## Keywords
504
+
505
+ #### pygame, splash screen, loading screen, opencv, video rendering, python GUI, pygame framework, splashscreen, animated loader, desktop application, threaded rendering
506
+ ---
@@ -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
+ return
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
+