├── .gitignore
├── README.md
├── auto_image_loading_example.py
├── button_theming_test.py
├── camera_window_test.py
├── colour_picker_test.py
├── data
├── __init__.py
├── fonts
│ ├── Amiri-Regular.ttf
│ ├── KosugiMaru-Regular.ttf
│ ├── MaShanZheng-Regular.ttf
│ ├── Montserrat-Bold.ttf
│ ├── Montserrat-BoldItalic.ttf
│ ├── Montserrat-Italic.ttf
│ ├── Montserrat-LICENSE.txt
│ ├── Montserrat-Regular.ttf
│ ├── NotoRashiHebrew-Regular.ttf
│ ├── NotoSerifGeorgian-Regular.ttf
│ ├── PermanentMarker-Regular.ttf
│ ├── SongMyung-Regular.ttf
│ └── __init__.py
├── guiopedia
│ ├── aliens.html
│ ├── cats.html
│ ├── gravel.html
│ └── index.html
├── images
│ ├── __init__.py
│ ├── home_icon.png
│ ├── measure.png
│ ├── space
│ │ ├── __init__.py
│ │ ├── space_1.jpg
│ │ ├── space_10.jpg
│ │ ├── space_11.jpg
│ │ ├── space_12.jpg
│ │ ├── space_13.jpg
│ │ ├── space_14.jpg
│ │ ├── space_15.jpg
│ │ ├── space_16.jpg
│ │ ├── space_2.jpg
│ │ ├── space_3.jpg
│ │ ├── space_4.jpg
│ │ ├── space_5.jpg
│ │ ├── space_6.jpg
│ │ ├── space_7.jpg
│ │ ├── space_8.jpg
│ │ └── space_9.jpg
│ ├── splat.bmp
│ ├── splat.png
│ ├── test_emoji.png
│ └── test_images
│ │ ├── field_of_gold.jpg
│ │ ├── london.jpg
│ │ └── paris.jpg
├── themes
│ ├── __init__.py
│ ├── button_theming_test_theme.json
│ ├── camera_theme.json
│ ├── colour_picker_app_theme.json
│ ├── console_theme.json
│ ├── documentation_theme.json
│ ├── embedded_images_theme.json
│ ├── guiopedia_theme.json
│ ├── image_load_app_theme.json
│ ├── image_loading_test.json
│ ├── notepad_theme.json
│ ├── pyinstaller_theme.json
│ ├── quick_theme.json
│ ├── status_bar_theme.json
│ ├── text_effects_theme.json
│ ├── theme_1.json
│ ├── theme_2.json
│ ├── theme_3.json
│ ├── translations_theme.json
│ └── two_sided_border_theme.json
└── translations
│ ├── examples.ar.json
│ ├── examples.de.json
│ ├── examples.en.json
│ ├── examples.es.json
│ ├── examples.fr.json
│ ├── examples.ge.json
│ ├── examples.he.json
│ ├── examples.id.json
│ ├── examples.it.json
│ ├── examples.ja.json
│ ├── examples.ko.json
│ ├── examples.pl.json
│ ├── examples.pt.json
│ ├── examples.ru.json
│ ├── examples.uk.json
│ ├── examples.vi.json
│ └── examples.zh.json
├── docs
└── example_1.png
├── documentation_test.py
├── example_auto_scale_button_images.py
├── example_check_box_multi_image.py
├── example_image_positioning.py
├── file_dialog_test.py
├── general_ui_test_app.py
├── gradient_test.py
├── guiopedia.py
├── layout_anchor_test.py
├── new_text_test.py
├── pong
├── ball.py
├── bat.py
├── pong.py
├── score.py
└── wall.py
├── pygame_notepad.py
├── pyinstaller_specs
├── pyinstaller_build.spec
└── pyinstaller_onefile_build.spec
├── pyinstaller_test.py
├── quick_start.py
├── resizing_test.py
├── scrolling_container_test.py
├── shape_packing_cache_test.py
├── status_bars.py
├── text_console.py
├── text_effects.py
├── text_embedded_images.py
├── text_test.py
├── translations_test.py
├── two_sided_border_button.py
├── ui_element_creation_speed_test.py
├── user_controlled_image_loading_example.py
├── using_ui_form.py
└── windowed_mini_games_app.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Python template
3 | # Byte-compiled / optimized / DLL files
4 | __pycache__/
5 | *$py.class
6 |
7 | # C extensions
8 | *.so
9 |
10 | # Distribution / packaging
11 | .Python
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | wheels/
24 | pip-wheel-metadata/
25 | share/python-wheels/
26 | *.egg-info/
27 | .installed.cfg
28 | *.egg
29 | MANIFEST
30 |
31 | # PyInstaller
32 | # Usually these files are written by a python script from a template
33 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
34 | *.manifest
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | .hypothesis/
51 | .pytest_cache/
52 |
53 | # Translations
54 | *.mo
55 | *.pot
56 |
57 | # Django stuff:
58 | *.log
59 | local_settings.py
60 | db.sqlite3
61 |
62 | # Flask stuff:
63 | instance/
64 | .webassets-cache
65 |
66 | # Scrapy stuff:
67 | .scrapy
68 |
69 | # Sphinx documentation
70 |
71 | # PyBuilder
72 | target/
73 |
74 | # Jupyter Notebook
75 | .ipynb_checkpoints
76 |
77 | # IPython
78 | profile_default/
79 | ipython_config.py
80 |
81 | # pyenv
82 | .python-version
83 |
84 | # pipenv
85 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
86 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
87 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
88 | # install all needed dependencies.
89 | #Pipfile.lock
90 |
91 | # celery beat schedule file
92 | celerybeat-schedule
93 |
94 | # SageMath parsed files
95 | *.sage.py
96 |
97 | # Environments
98 | .env
99 | .venv
100 | env/
101 | venv/
102 | ENV/
103 | env.bak/
104 | venv.bak/
105 |
106 | # Spyder project settings
107 | .spyderproject
108 | .spyproject
109 |
110 | # Rope project settings
111 | .ropeproject
112 |
113 | # mkdocs documentation
114 | /site
115 |
116 | # mypy
117 | .mypy_cache/
118 | .dmypy.json
119 | dmypy.json
120 |
121 | # Pyre type checker
122 | .pyre/
123 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pygame GUI Examples
2 | A few simple programs to demonstrate how to use features of the [pygame_gui](https://github.com/MyreMylar/pygame_gui) module.
3 |
4 | To run these programs you must first have installed the [pygame_gui](https://github.com/MyreMylar/pygame_gui) project (which itself depends on pygame-ce).
5 |
6 | It's also worth noting that [pygame_gui](https://github.com/MyreMylar/pygame_gui) is designed to work with pygame-ce.
7 |
8 | 
9 |
10 | 
11 |
--------------------------------------------------------------------------------
/auto_image_loading_example.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | import pygame_gui
3 |
4 |
5 | # 20 * image buttons
6 | # Network drive: Auto Image loading time taken: 14-17 seconds.
7 |
8 | pygame.init()
9 |
10 |
11 | pygame.display.set_caption('Image Loading Test')
12 | window_surface = pygame.display.set_mode((800, 600))
13 | background = pygame.Surface((800, 600))
14 | background.fill(pygame.Color('#000000'))
15 | clock = pygame.time.Clock()
16 | load_time_1 = clock.tick()
17 | manager = pygame_gui.UIManager((800, 600), 'data/themes/image_loading_test.json')
18 |
19 | load_time_2 = clock.tick()
20 |
21 | print('Image loading time taken:', load_time_2 / 1000.0, 'seconds.')
22 |
23 | button_row_width = 200
24 | button_row_height = 150
25 | spacing = 0
26 | num_buttons = 1
27 | for j in range(1, 5):
28 | for i in range(1, 5):
29 | position = (i * spacing + ((i - 1) * button_row_width),
30 | (j * spacing + ((j - 1) * button_row_height)))
31 | pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position,
32 | (button_row_width,
33 | button_row_height)),
34 | text=str(num_buttons),
35 | manager=manager,
36 | object_id='#'+str(num_buttons))
37 | num_buttons += 1
38 |
39 | is_running = True
40 |
41 | while is_running:
42 | time_delta = clock.tick(60)/1000.0
43 | for event in pygame.event.get():
44 | if event.type == pygame.QUIT:
45 | is_running = False
46 |
47 | manager.process_events(event)
48 |
49 | manager.update(time_delta)
50 |
51 | window_surface.blit(background, (0, 0))
52 | manager.draw_ui(window_surface)
53 |
54 | pygame.display.update()
55 |
--------------------------------------------------------------------------------
/button_theming_test.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | import pygame_gui
3 |
4 | # Rough current performance measure - Button creation time taken: 0.08 seconds.
5 | # (54 x rounded rectangles)
6 |
7 | pygame.init()
8 |
9 |
10 | pygame.display.set_caption('Button Theming Test')
11 | window_surface = pygame.display.set_mode((800, 600))
12 | manager = pygame_gui.UIManager((800, 600), 'data/themes/button_theming_test_theme.json')
13 | clock = pygame.time.Clock()
14 |
15 | background = pygame.Surface((800, 600))
16 | background.fill(manager.get_theme().get_colour('dark_bg'))
17 |
18 | load_time_1 = clock.tick()
19 |
20 | button_row_width = 100
21 | button_row_height = 40
22 | spacing = 20
23 | for j in range(1, 10):
24 | for i in range(1, 7):
25 | position = (i * spacing + ((i - 1) * button_row_width),
26 | (j * spacing + ((j - 1) * button_row_height)))
27 | pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position,
28 | (button_row_width,
29 | button_row_height)),
30 | text=str(i) + ',' + str(j),
31 | manager=manager,
32 | object_id='#' + str(i) + ',' + str(j))
33 |
34 | load_time_2 = clock.tick()
35 | print('Button creation time taken:', load_time_2/1000.0, 'seconds.')
36 |
37 | is_running = True
38 |
39 | while is_running:
40 | time_delta = clock.tick(60)/1000.0
41 | for event in pygame.event.get():
42 | if event.type == pygame.QUIT:
43 | is_running = False
44 |
45 | manager.process_events(event)
46 |
47 | manager.update(time_delta)
48 |
49 | window_surface.blit(background, (0, 0))
50 | manager.draw_ui(window_surface)
51 |
52 | pygame.display.update()
53 |
--------------------------------------------------------------------------------
/camera_window_test.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | import pygame.camera
3 | import pygame_gui
4 |
5 |
6 | """
7 | Uses Pygame Camera module to display a webcam in a window
8 | """
9 |
10 |
11 | class CameraWindow(pygame_gui.elements.UIWindow):
12 | def __init__(self,
13 | rect: pygame.Rect,
14 | camera_name,
15 | ui_manager: pygame_gui.core.interfaces.IUIManagerInterface):
16 | super().__init__(rect, ui_manager, window_display_title=camera_name, resizable=True)
17 |
18 | self.camera = None
19 |
20 | self.camera = pygame.camera.Camera(camera_name, (640, 480))
21 | self.camera.start()
22 |
23 | print(self.camera.get_controls())
24 |
25 | cam_rect = pygame.Rect((0, 0), self.get_container().rect.size)
26 | self.cam_image = pygame_gui.elements.UIImage(relative_rect=cam_rect,
27 | image_surface=self.camera.get_image(),
28 | manager=self.ui_manager,
29 | container=self,
30 | anchors={'left': 'left',
31 | 'right': 'right',
32 | 'top': 'top',
33 | 'bottom': 'bottom'})
34 |
35 | def update(self, time_delta: float):
36 | super().update(time_delta)
37 |
38 | if self.camera is not None:
39 |
40 | self.cam_image.set_image(pygame.transform.smoothscale(self.camera.get_image(),
41 | self.get_container().rect.size))
42 |
43 |
44 | pygame.init()
45 | pygame.camera.init()
46 |
47 | print(pygame.camera.get_backends())
48 | print(pygame.camera.list_cameras())
49 |
50 | pygame.display.set_caption('Quick Start')
51 | window_surface = pygame.display.set_mode((800, 600))
52 | manager = pygame_gui.UIManager((800, 600), 'data/themes/camera_theme.json')
53 |
54 | background = pygame.Surface((800, 600))
55 | background.fill(manager.ui_theme.get_colour('dark_bg'))
56 |
57 |
58 | cam_window_pos = [10, 10]
59 | num_connected_cameras = 1
60 | cam_names = pygame.camera.list_cameras()
61 | for cam_name in cam_names:
62 | cam_window_rect = pygame.Rect(0, 0, 400, 300)
63 | cam_window_rect.topleft = cam_window_pos
64 | CameraWindow(cam_window_rect, cam_name, manager)
65 | cam_window_pos = (cam_window_pos[0] + 420,
66 | cam_window_pos[1])
67 |
68 | clock = pygame.time.Clock()
69 | is_running = True
70 |
71 | while is_running:
72 | time_delta = clock.tick(60)/1000.0
73 | for event in pygame.event.get():
74 | if event.type == pygame.QUIT:
75 | is_running = False
76 |
77 | manager.process_events(event)
78 |
79 | manager.update(time_delta)
80 |
81 | window_surface.blit(background, (0, 0))
82 | manager.draw_ui(window_surface)
83 |
84 | pygame.display.update()
85 |
--------------------------------------------------------------------------------
/colour_picker_test.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | import pygame_gui
3 |
4 | from pygame_gui.elements import UIButton
5 | from pygame_gui.windows import UIColourPickerDialog
6 |
7 |
8 | class ColourPickingApp:
9 | def __init__(self):
10 | pygame.init()
11 |
12 | pygame.display.set_caption('Colour Picking App')
13 | self.window_surface = pygame.display.set_mode((800, 600))
14 | self.ui_manager = pygame_gui.UIManager((800, 600),
15 | 'data/themes/colour_picker_app_theme.json')
16 |
17 | self.background = pygame.Surface((800, 600))
18 | self.background.fill(self.ui_manager.ui_theme.get_colour('dark_bg'))
19 |
20 | self.pick_colour_button = UIButton(relative_rect=pygame.Rect(-180, -60, 150, 30),
21 | text='Pick Colour',
22 | manager=self.ui_manager,
23 | anchors={'left': 'right',
24 | 'right': 'right',
25 | 'top': 'bottom',
26 | 'bottom': 'bottom'})
27 |
28 | self.colour_picker = None
29 |
30 | self.current_colour = pygame.Color(0, 0, 0)
31 | self.picked_colour_surface = pygame.Surface((400, 400))
32 | self.picked_colour_surface.fill(self.current_colour)
33 |
34 | self.clock = pygame.time.Clock()
35 | self.is_running = True
36 |
37 | def run(self):
38 | while self.is_running:
39 | time_delta = self.clock.tick(60) / 1000.0
40 | for event in pygame.event.get():
41 | if event.type == pygame.QUIT:
42 | self.is_running = False
43 |
44 | if (event.type == pygame_gui.UI_BUTTON_PRESSED and
45 | event.ui_element == self.pick_colour_button):
46 | self.colour_picker = UIColourPickerDialog(pygame.Rect(160, 50, 420, 400),
47 | self.ui_manager,
48 | window_title='Change Colour...',
49 | initial_colour=self.current_colour)
50 | self.pick_colour_button.disable()
51 |
52 | if event.type == pygame_gui.UI_COLOUR_PICKER_COLOUR_PICKED:
53 | self.current_colour = event.colour
54 | self.picked_colour_surface.fill(self.current_colour)
55 |
56 | if (event.type == pygame_gui.UI_WINDOW_CLOSE and
57 | event.ui_element == self.colour_picker):
58 | self.pick_colour_button.enable()
59 | self.colour_picker = None
60 |
61 | self.ui_manager.process_events(event)
62 |
63 | self.ui_manager.update(time_delta)
64 |
65 | self.window_surface.blit(self.background, (0, 0))
66 | self.window_surface.blit(self.picked_colour_surface, (200, 100))
67 | self.ui_manager.draw_ui(self.window_surface)
68 |
69 | pygame.display.update()
70 |
71 |
72 | if __name__ == "__main__":
73 | app = ColourPickingApp()
74 | app.run()
75 |
--------------------------------------------------------------------------------
/data/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/__init__.py
--------------------------------------------------------------------------------
/data/fonts/Amiri-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/Amiri-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/KosugiMaru-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/KosugiMaru-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/MaShanZheng-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/MaShanZheng-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/Montserrat-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/Montserrat-Bold.ttf
--------------------------------------------------------------------------------
/data/fonts/Montserrat-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/Montserrat-BoldItalic.ttf
--------------------------------------------------------------------------------
/data/fonts/Montserrat-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/Montserrat-Italic.ttf
--------------------------------------------------------------------------------
/data/fonts/Montserrat-LICENSE.txt:
--------------------------------------------------------------------------------
1 | JulietaUla/Montserrat is licensed under the
2 |
3 | SIL Open Font License 1.1
4 | The Open Font License (OFL) is maintained by SIL International. It attempts to be a compromise between the values of the free software and typeface design communities. It is used for almost all open source font projects, including those by Adobe, Google and Mozilla.
5 |
6 | Permissions
7 | Private use
8 | Commercial use
9 | Modification
10 | Distribution
11 | Limitations
12 | Liability
13 | Warranty
14 | Conditions
15 | License and copyright notice
16 | Same license
17 | This is not legal advice. Learn more about repository licenses.
18 | @m4rc1e m4rc1e Updated vertical metrics and copyright string
19 | 156b817 on 31 Oct 2017
20 | @m4rc1e@graphicore
21 | 94 lines (75 sloc) 4.29 KB
22 |
23 | Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
24 |
25 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
26 | This license is copied below, and is also available with a FAQ at:
27 | http://scripts.sil.org/OFL
28 |
29 |
30 | -----------------------------------------------------------
31 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
32 | -----------------------------------------------------------
33 |
34 | PREAMBLE
35 | The goals of the Open Font License (OFL) are to stimulate worldwide
36 | development of collaborative font projects, to support the font creation
37 | efforts of academic and linguistic communities, and to provide a free and
38 | open framework in which fonts may be shared and improved in partnership
39 | with others.
40 |
41 | The OFL allows the licensed fonts to be used, studied, modified and
42 | redistributed freely as long as they are not sold by themselves. The
43 | fonts, including any derivative works, can be bundled, embedded,
44 | redistributed and/or sold with any software provided that any reserved
45 | names are not used by derivative works. The fonts and derivatives,
46 | however, cannot be released under any other type of license. The
47 | requirement for fonts to remain under this license does not apply
48 | to any document created using the fonts or their derivatives.
49 |
50 | DEFINITIONS
51 | "Font Software" refers to the set of files released by the Copyright
52 | Holder(s) under this license and clearly marked as such. This may
53 | include source files, build scripts and documentation.
54 |
55 | "Reserved Font Name" refers to any names specified as such after the
56 | copyright statement(s).
57 |
58 | "Original Version" refers to the collection of Font Software components as
59 | distributed by the Copyright Holder(s).
60 |
61 | "Modified Version" refers to any derivative made by adding to, deleting,
62 | or substituting -- in part or in whole -- any of the components of the
63 | Original Version, by changing formats or by porting the Font Software to a
64 | new environment.
65 |
66 | "Author" refers to any designer, engineer, programmer, technical
67 | writer or other person who contributed to the Font Software.
68 |
69 | PERMISSION & CONDITIONS
70 | Permission is hereby granted, free of charge, to any person obtaining
71 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
72 | redistribute, and sell modified and unmodified copies of the Font
73 | Software, subject to the following conditions:
74 |
75 | 1) Neither the Font Software nor any of its individual components,
76 | in Original or Modified Versions, may be sold by itself.
77 |
78 | 2) Original or Modified Versions of the Font Software may be bundled,
79 | redistributed and/or sold with any software, provided that each copy
80 | contains the above copyright notice and this license. These can be
81 | included either as stand-alone text files, human-readable headers or
82 | in the appropriate machine-readable metadata fields within text or
83 | binary files as long as those fields can be easily viewed by the user.
84 |
85 | 3) No Modified Version of the Font Software may use the Reserved Font
86 | Name(s) unless explicit written permission is granted by the corresponding
87 | Copyright Holder. This restriction only applies to the primary font name as
88 | presented to the users.
89 |
90 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
91 | Software shall not be used to promote, endorse or advertise any
92 | Modified Version, except to acknowledge the contribution(s) of the
93 | Copyright Holder(s) and the Author(s) or with their explicit written
94 | permission.
95 |
96 | 5) The Font Software, modified or unmodified, in part or in whole,
97 | must be distributed entirely under this license, and must not be
98 | distributed under any other license. The requirement for fonts to
99 | remain under this license does not apply to any document created
100 | using the Font Software.
101 |
102 | TERMINATION
103 | This license becomes null and void if any of the above conditions are
104 | not met.
105 |
106 | DISCLAIMER
107 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
108 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
109 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
110 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
111 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
112 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
113 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
114 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
115 | OTHER DEALINGS IN THE FONT SOFTWARE.
--------------------------------------------------------------------------------
/data/fonts/Montserrat-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/Montserrat-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/NotoRashiHebrew-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/NotoRashiHebrew-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/NotoSerifGeorgian-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/NotoSerifGeorgian-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/PermanentMarker-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/PermanentMarker-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/SongMyung-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/SongMyung-Regular.ttf
--------------------------------------------------------------------------------
/data/fonts/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/fonts/__init__.py
--------------------------------------------------------------------------------
/data/guiopedia/aliens.html:
--------------------------------------------------------------------------------
1 | Aliens
2 |
3 | Contrary to most popular media, the average alien is quite a boring fellow. By and large they prefer to hang around in cubicles contemplating
4 | the meaning of filing identically shaped cubes. It's best not to bother with them really, terribly dull.
5 |
6 | Why don't you go think about cats instead?
--------------------------------------------------------------------------------
/data/guiopedia/cats.html:
--------------------------------------------------------------------------------
1 | Cats!
2 |
3 | The mightiest creatures on planet earth cats are know for their impressive pouncing capabilities,
4 | their soft bellies and unmatched capacity for lurking where you least expect.
5 |
6 | But what is the truth of cats? The very essence of catty cattitude? How many cats can fit in a shoebox?
7 | Do cats get on with gravel? Find out more below.
8 |
9 | Famous Cats
10 |
11 | - Sir Pouncealot: A knight of the round bowl.
12 | - Count Catula: A much maligned hero of the people.
--------------------------------------------------------------------------------
/data/guiopedia/gravel.html:
--------------------------------------------------------------------------------
1 | Gravel: The Full Facts
2 |
3 | For too long they have remained hidden, but now we can exclusively reveal the truth behind the tiny bits of rock.
4 | Some say they were first formed by an ancient alien race, or were the leftovers of an enormous magical ritual that
5 | forever drained planet earth of precious life-giving magic.
6 |
7 | The real facts are more sinister still...
--------------------------------------------------------------------------------
/data/guiopedia/index.html:
--------------------------------------------------------------------------------
1 | Welcome to GUI-opedia!
2 |
3 | This is a little test of creating a few hyperlink connected pages that we can display to
4 | the user to give them more information. Maybe it'll have a search bar as well? Oh, hey now it does.
5 |
6 | The point is we have multiple pages of text that we load in from files, and then we can navigate between them via links
7 | all inside of a window. Here are a few of them to try clicking on:
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | - Cats - A page all about cats.
30 | - Gravel - Gravel: What is the deal.
31 |
--------------------------------------------------------------------------------
/data/images/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/__init__.py
--------------------------------------------------------------------------------
/data/images/home_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/home_icon.png
--------------------------------------------------------------------------------
/data/images/measure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/measure.png
--------------------------------------------------------------------------------
/data/images/space/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/__init__.py
--------------------------------------------------------------------------------
/data/images/space/space_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_1.jpg
--------------------------------------------------------------------------------
/data/images/space/space_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_10.jpg
--------------------------------------------------------------------------------
/data/images/space/space_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_11.jpg
--------------------------------------------------------------------------------
/data/images/space/space_12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_12.jpg
--------------------------------------------------------------------------------
/data/images/space/space_13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_13.jpg
--------------------------------------------------------------------------------
/data/images/space/space_14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_14.jpg
--------------------------------------------------------------------------------
/data/images/space/space_15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_15.jpg
--------------------------------------------------------------------------------
/data/images/space/space_16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_16.jpg
--------------------------------------------------------------------------------
/data/images/space/space_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_2.jpg
--------------------------------------------------------------------------------
/data/images/space/space_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_3.jpg
--------------------------------------------------------------------------------
/data/images/space/space_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_4.jpg
--------------------------------------------------------------------------------
/data/images/space/space_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_5.jpg
--------------------------------------------------------------------------------
/data/images/space/space_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_6.jpg
--------------------------------------------------------------------------------
/data/images/space/space_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_7.jpg
--------------------------------------------------------------------------------
/data/images/space/space_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_8.jpg
--------------------------------------------------------------------------------
/data/images/space/space_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/space/space_9.jpg
--------------------------------------------------------------------------------
/data/images/splat.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/splat.bmp
--------------------------------------------------------------------------------
/data/images/splat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/splat.png
--------------------------------------------------------------------------------
/data/images/test_emoji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/test_emoji.png
--------------------------------------------------------------------------------
/data/images/test_images/field_of_gold.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/test_images/field_of_gold.jpg
--------------------------------------------------------------------------------
/data/images/test_images/london.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/test_images/london.jpg
--------------------------------------------------------------------------------
/data/images/test_images/paris.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/images/test_images/paris.jpg
--------------------------------------------------------------------------------
/data/themes/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/data/themes/__init__.py
--------------------------------------------------------------------------------
/data/themes/button_theming_test_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "#1,1":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "18",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | },
12 | "#2,1":
13 | {
14 | "misc":
15 | {
16 | "shape": "rounded_rectangle",
17 | "shape_corner_radius": "14",
18 | "border_width": "1",
19 | "shadow_width": "2"
20 | }
21 | },
22 | "#3,1":
23 | {
24 | "misc":
25 | {
26 | "shape": "rounded_rectangle",
27 | "shape_corner_radius": "10",
28 | "border_width": "1",
29 | "shadow_width": "2"
30 | }
31 | },
32 | "#4,1":
33 | {
34 | "misc":
35 | {
36 | "shape": "rounded_rectangle",
37 | "shape_corner_radius": "6",
38 | "border_width": "1",
39 | "shadow_width": "2"
40 | }
41 | },
42 | "#5,1":
43 | {
44 | "misc":
45 | {
46 | "shape": "rounded_rectangle",
47 | "shape_corner_radius": "4",
48 | "border_width": "1",
49 | "shadow_width": "2"
50 | }
51 | },
52 | "#6,1":
53 | {
54 | "misc":
55 | {
56 | "shape": "rounded_rectangle",
57 | "shape_corner_radius": "2",
58 | "border_width": "1",
59 | "shadow_width": "2"
60 | }
61 | },
62 | "#1,2":
63 | {
64 | "misc":
65 | {
66 | "shape": "rounded_rectangle",
67 | "shape_corner_radius": "18",
68 | "border_width": "18",
69 | "shadow_width": "2"
70 | }
71 | },
72 | "#2,2":
73 | {
74 | "misc":
75 | {
76 | "shape": "rounded_rectangle",
77 | "shape_corner_radius": "14",
78 | "border_width": "14",
79 | "shadow_width": "2"
80 | }
81 | },
82 | "#3,2":
83 | {
84 | "misc":
85 | {
86 | "shape": "rounded_rectangle",
87 | "shape_corner_radius": "10",
88 | "border_width": "10",
89 | "shadow_width": "2"
90 | }
91 | },
92 | "#4,2":
93 | {
94 | "misc":
95 | {
96 | "shape": "rounded_rectangle",
97 | "shape_corner_radius": "6",
98 | "border_width": "6",
99 | "shadow_width": "2"
100 | }
101 | },
102 | "#5,2":
103 | {
104 | "misc":
105 | {
106 | "shape": "rounded_rectangle",
107 | "shape_corner_radius": "4",
108 | "border_width": "4",
109 | "shadow_width": "2"
110 | }
111 | },
112 | "#6,2":
113 | {
114 | "misc":
115 | {
116 | "shape": "rounded_rectangle",
117 | "shape_corner_radius": "2",
118 | "border_width": "2",
119 | "shadow_width": "2"
120 | }
121 | },
122 | "#1,3":
123 | {
124 | "misc":
125 | {
126 | "shape": "rounded_rectangle",
127 | "shape_corner_radius": "2",
128 | "border_width": "2",
129 | "shadow_width": "18"
130 | }
131 | },
132 | "#2,3":
133 | {
134 | "misc":
135 | {
136 | "shape": "rounded_rectangle",
137 | "shape_corner_radius": "2",
138 | "border_width": "2",
139 | "shadow_width": "14"
140 | }
141 | },
142 | "#3,3":
143 | {
144 | "misc":
145 | {
146 | "shape": "rounded_rectangle",
147 | "shape_corner_radius": "2",
148 | "border_width": "2",
149 | "shadow_width": "10"
150 | }
151 | },
152 | "#4,3":
153 | {
154 | "misc":
155 | {
156 | "shape": "rounded_rectangle",
157 | "shape_corner_radius": "2",
158 | "border_width": "2",
159 | "shadow_width": "6"
160 | }
161 | },
162 | "#5,3":
163 | {
164 | "misc":
165 | {
166 | "shape": "rounded_rectangle",
167 | "shape_corner_radius": "2",
168 | "border_width": "2",
169 | "shadow_width": "4"
170 | }
171 | },
172 | "#6,3":
173 | {
174 | "misc":
175 | {
176 | "shape": "rounded_rectangle",
177 | "shape_corner_radius": "2",
178 | "border_width": "2",
179 | "shadow_width": "2"
180 | }
181 | },
182 | "#1,4":
183 | {
184 | "colours":
185 | {
186 | "normal_bg": "#30AA30AA,#AA3030,180"
187 | },
188 | "misc":
189 | {
190 | "shape": "ellipse",
191 | "border_width": "1",
192 | "shadow_width": "2"
193 | }
194 | },
195 | "#2,4":
196 | {
197 | "colours":
198 | {
199 | "normal_bg": "#30AA30AA,#AA3030,180",
200 | "normal_border": "#30AA30AA,#AA3030,0"
201 | },
202 | "misc":
203 | {
204 | "shape": "ellipse",
205 | "border_width": "2",
206 | "shadow_width": "2"
207 | }
208 | },
209 | "#3,4":
210 | {
211 | "misc":
212 | {
213 | "shape": "ellipse",
214 | "border_width": "4",
215 | "shadow_width": "4"
216 | }
217 | },
218 | "#4,4":
219 | {
220 | "misc":
221 | {
222 | "shape": "ellipse",
223 | "border_width": "8",
224 | "shadow_width": "8"
225 | }
226 | },
227 | "#5,4":
228 | {
229 | "misc":
230 | {
231 | "shape": "ellipse",
232 | "border_width": "8",
233 | "shadow_width": "2"
234 | }
235 | },
236 | "#6,4":
237 | {
238 | "misc":
239 | {
240 | "shape": "ellipse",
241 | "border_width": "1",
242 | "shadow_width": "8"
243 | }
244 | },
245 | "#1,5":
246 | {
247 | "colours":
248 | {
249 | "normal_bg": "#AA3030"
250 | },
251 | "misc":
252 | {
253 | "shape": "rounded_rectangle",
254 | "shape_corner_radius": "2",
255 | "border_width": "2",
256 | "shadow_width": "2"
257 | }
258 | },
259 | "#2,5":
260 | {
261 | "colours":
262 | {
263 | "normal_bg": "#30AA30"
264 | },
265 | "misc":
266 | {
267 | "shape": "rounded_rectangle",
268 | "shape_corner_radius": "10",
269 | "border_width": "2",
270 | "shadow_width": "2"
271 | }
272 | },
273 | "#3,5":
274 | {
275 | "colours":
276 | {
277 | "normal_bg": "#3030AA"
278 | },
279 | "misc":
280 | {
281 | "shape": "rounded_rectangle",
282 | "shape_corner_radius": "2",
283 | "border_width": "5",
284 | "shadow_width": "2"
285 | }
286 | },
287 | "#4,5":
288 | {
289 | "colours":
290 | {
291 | "normal_border": "#AA3030"
292 | },
293 | "misc":
294 | {
295 | "shape": "rounded_rectangle",
296 | "shape_corner_radius": "2",
297 | "border_width": "2",
298 | "shadow_width": "2"
299 | }
300 | },
301 | "#5,5":
302 | {
303 | "colours":
304 | {
305 | "normal_border": "#30AA30"
306 | },
307 | "misc":
308 | {
309 | "shape": "rounded_rectangle",
310 | "shape_corner_radius": "10",
311 | "border_width": "2",
312 | "shadow_width": "2"
313 | }
314 | },
315 | "#6,5":
316 | {
317 | "colours":
318 | {
319 | "normal_border": "#3030AA"
320 | },
321 | "misc":
322 | {
323 | "shape": "rounded_rectangle",
324 | "shape_corner_radius": "2",
325 | "border_width": "5",
326 | "shadow_width": "2"
327 | }
328 | },
329 | "#1,6":
330 | {
331 | "colours":
332 | {
333 | "normal_bg": "#AA303050"
334 | },
335 | "misc":
336 | {
337 | "shape": "rounded_rectangle",
338 | "shape_corner_radius": "2",
339 | "border_width": "2",
340 | "shadow_width": "2",
341 | "border_overlap": "0"
342 | }
343 | },
344 | "#2,6":
345 | {
346 | "colours":
347 | {
348 | "normal_bg": "#30AA30AA"
349 | },
350 | "misc":
351 | {
352 | "shape": "rounded_rectangle",
353 | "shape_corner_radius": "10",
354 | "border_width": "2",
355 | "shadow_width": "2",
356 | "border_overlap": "0"
357 | }
358 | },
359 | "#3,6":
360 | {
361 | "colours":
362 | {
363 | "normal_bg": "#3030AAEE"
364 | },
365 | "misc":
366 | {
367 | "shape": "rounded_rectangle",
368 | "shape_corner_radius": "2",
369 | "border_width": "5",
370 | "shadow_width": "2"
371 | }
372 | },
373 | "#4,6":
374 | {
375 | "colours":
376 | {
377 | "normal_border": "#AA3030EE"
378 | },
379 | "misc":
380 | {
381 | "shape": "rounded_rectangle",
382 | "shape_corner_radius": "2",
383 | "border_width": "2",
384 | "shadow_width": "2"
385 | }
386 | },
387 | "#5,6":
388 | {
389 | "colours":
390 | {
391 | "normal_border": "#30AA30AA"
392 | },
393 | "misc":
394 | {
395 | "shape": "rounded_rectangle",
396 | "shape_corner_radius": "10",
397 | "border_width": "2",
398 | "shadow_width": "2"
399 | }
400 | },
401 | "#6,6":
402 | {
403 | "colours":
404 | {
405 | "normal_border": "#3030AA50"
406 | },
407 | "misc":
408 | {
409 | "shape": "rounded_rectangle",
410 | "shape_corner_radius": "2",
411 | "border_width": "5",
412 | "shadow_width": "2"
413 | }
414 | },
415 | "#1,7":
416 | {
417 | "colours":
418 | {
419 | "normal_bg": "#AA303050,#AA3030,0"
420 | },
421 | "misc":
422 | {
423 | "shape": "rounded_rectangle",
424 | "shape_corner_radius": "2",
425 | "border_width": "2",
426 | "shadow_width": "2",
427 | "border_overlap": "0"
428 | }
429 | },
430 | "#2,7":
431 | {
432 | "colours":
433 | {
434 | "normal_bg": "#30AA30AA,#AA3030,180"
435 | },
436 | "misc":
437 | {
438 | "shape": "rounded_rectangle",
439 | "shape_corner_radius": "10",
440 | "border_width": "2",
441 | "shadow_width": "2",
442 | "border_overlap": "0"
443 | }
444 | },
445 | "#3,7":
446 | {
447 | "colours":
448 | {
449 | "normal_bg": "#3030AAEE,#AA3030,90"
450 | },
451 | "misc":
452 | {
453 | "shape": "rounded_rectangle",
454 | "shape_corner_radius": "2",
455 | "border_width": "5",
456 | "shadow_width": "2"
457 | }
458 | },
459 | "#4,7":
460 | {
461 | "colours":
462 | {
463 | "normal_border": "#AA3030EE,#303AA050,-90"
464 | },
465 | "misc":
466 | {
467 | "shape": "rounded_rectangle",
468 | "shape_corner_radius": "2",
469 | "border_width": "2",
470 | "shadow_width": "2"
471 | }
472 | },
473 | "#5,7":
474 | {
475 | "colours":
476 | {
477 | "normal_border": "#30AA30AA,#3030AAAA,-45"
478 | },
479 | "misc":
480 | {
481 | "shape": "rounded_rectangle",
482 | "shape_corner_radius": "10",
483 | "border_width": "2",
484 | "shadow_width": "2"
485 | }
486 | },
487 | "#6,7":
488 | {
489 | "colours":
490 | {
491 | "normal_border": "#3030AA50,#3030AAAA,60"
492 | },
493 | "misc":
494 | {
495 | "shape": "rounded_rectangle",
496 | "shape_corner_radius": "2",
497 | "border_width": "5",
498 | "shadow_width": "2"
499 | }
500 | }
501 | }
--------------------------------------------------------------------------------
/data/themes/camera_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "1,20,10,20",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | },
12 | "window":
13 | {
14 | "misc":
15 | {
16 | "shape": "rounded_rectangle",
17 | "shape_corner_radius": "10,10,0,0"
18 | }
19 | },
20 | "window.#title_bar":
21 | {
22 | "misc":
23 | {
24 | "shape": "rounded_rectangle",
25 | "shape_corner_radius": "10,0,0,0"
26 | }
27 | },
28 | "window.#close_button":
29 | {
30 | "misc":
31 | {
32 | "shape": "rounded_rectangle",
33 | "shape_corner_radius": "0,10,0,0"
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/data/themes/colour_picker_app_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "10",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/data/themes/console_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "1,20,10,20",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | },
12 | "window":
13 | {
14 | "misc":
15 | {
16 | "shape": "rounded_rectangle",
17 | "shape_corner_radius": "10,10,0,0"
18 | }
19 | },
20 | "window.#title_bar":
21 | {
22 | "misc":
23 | {
24 | "shape": "rounded_rectangle",
25 | "shape_corner_radius": "10,0,0,0"
26 | }
27 | },
28 | "window.#close_button":
29 | {
30 | "misc":
31 | {
32 | "shape": "rounded_rectangle",
33 | "shape_corner_radius": "0,10,0,0"
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/data/themes/documentation_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults":
3 | {
4 | "colours":
5 | {
6 | "normal_bg": "#b5b4b5",
7 | "dark_bg": "#A0A0A0",
8 | "normal_text": "#101010",
9 | "normal_border": "#505050"
10 | }
11 | },
12 |
13 | "drop_down_menu":
14 | {
15 | "colours":
16 | {
17 | "dark_bg": "#A0A0A0"
18 | },
19 | "misc":
20 | {
21 | "shape": "rounded_rectangle",
22 | "border_width": "5",
23 | "shadow_width": "8",
24 | "shape_corner_radius": "8"
25 | }
26 | },
27 | "drop_down_menu.button":
28 | {
29 | "colours":
30 | {
31 | "normal_bg": "#9090D000"
32 | },
33 | "misc":
34 | {
35 | "shape": "rounded_rectangle",
36 | "border_width": "0",
37 | "shadow_width": "0",
38 | "shape_corner_radius": "5"
39 | }
40 | },
41 |
42 | "screen_space_health_bar":
43 | {
44 | "colours":
45 | {
46 | "normal_text": "#E0E0E0",
47 | "text_shadow": "#202020",
48 | "normal_border": "#202020",
49 | "filled_bar": "#F04040A0,#A03080A0,90",
50 | "unfilled_bar": "#A0A0A0A0,#A0A0A050,270"
51 | },
52 | "misc":
53 | {
54 | "shape": "rectangle",
55 | "shape_corner_radius": "15"
56 | }
57 | },
58 | "text_box":
59 | {
60 | "colours":
61 | {
62 | "normal_text": "#202020",
63 | "normal_border": "#202020",
64 | "dark_bg": "#A0A0A0",
65 | "link_text": "#C0E0FF"
66 | },
67 | "misc":
68 | {
69 | "shape": "rounded_rectangle",
70 | "shape_corner_radius": "15",
71 | "border_width": "3"
72 | }
73 | },
74 |
75 | "vertical_scroll_bar":
76 | {
77 | "colours":
78 | {
79 | "dark_bg": "#A0A0A0"
80 | },
81 | "misc":
82 | {
83 | "shape": "rounded_rectangle",
84 | "shape_corner_radius": "13",
85 | "border_width": "2"
86 | }
87 | },
88 | "vertical_scroll_bar.button":
89 | {
90 | "misc":
91 | {
92 | "shape": "rounded_rectangle",
93 | "border_width": "1",
94 | "shadow_width": "0",
95 | "shape_corner_radius": "9"
96 | }
97 | },
98 | "world_space_health_bar":
99 | {
100 | "colours":
101 | {
102 | "normal_text": "#E0E0E0",
103 | "text_shadow": "#202020",
104 | "normal_border": "#202020",
105 | "filled_bar": "#F04040A0,#A03080A0,90",
106 | "unfilled_bar": "#A0A0A0A0,#A0A0A050,270"
107 | },
108 | "misc":
109 | {
110 | "shape": "rounded_rectangle",
111 | "shape_corner_radius": "15",
112 | "border_width": "3"
113 | }
114 | },
115 | "panel":
116 | {
117 | "misc":
118 | {
119 | "border_width": "5",
120 | "shadow_width": "8",
121 | "shape_corner_radius": "8"
122 | }
123 | },
124 |
125 | "selection_list":
126 | {
127 | "misc":
128 | {
129 | "border_width": "5",
130 | "shadow_width": "2"
131 | }
132 | },
133 |
134 | "window":
135 | {
136 | "misc":
137 | {
138 | "border_width": "1"
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/data/themes/embedded_images_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "text_box":
3 | {
4 | "misc":
5 | {
6 | "shape": "rectangle",
7 | "text_horiz_alignment": "left",
8 | "line_spacing": "1.5"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/data/themes/guiopedia_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "#guiopedia_window":
3 | {
4 | "colours":
5 | {
6 | "dark_bg": "#4c5052"
7 | },
8 | "misc":
9 | {
10 | "title_bar_height": "28"
11 | }
12 | },
13 |
14 | "#guiopedia_window.text_box":
15 | {
16 | "colours":
17 | {
18 | "dark_bg": "#21282d"
19 | },
20 | "misc":
21 | {
22 | "title_bar_height": "28"
23 | }
24 | },
25 | "#guiopedia_window.#home_button":
26 | {
27 | "images":
28 | {
29 | "normal_image": {
30 | "path": "data/images/home_icon.png"
31 | }
32 | },
33 | "misc":
34 | {
35 | "shape": "ellipse"
36 | }
37 | },
38 |
39 | "#guiopedia_window.label":
40 | {
41 | "colours":
42 | {
43 | "dark_bg": "#4c5052"
44 | }
45 | },
46 |
47 | "#guiopedia_window.text_entry_line":
48 | {
49 | "colours":
50 | {
51 | "dark_bg": "#21282d"
52 | },
53 | "misc":
54 | {
55 | "shape": "rounded_rectangle",
56 | "shape_corner_radius": "12"
57 | }
58 | },
59 |
60 | "#guiopedia_window.#title_bar":
61 | {
62 | "colours":
63 | {
64 | "normal_bg": "#35393e",
65 | "hovered_bg": "#55595e"
66 | },
67 |
68 | "misc":
69 | {
70 | "text_horiz_alignment": "left",
71 | "text_horiz_alignment_padding": "10"
72 | }
73 | },
74 |
75 | "#guiopedia_window.#close_button":
76 | {
77 | "colours":
78 | {
79 | "normal_bg": "#35393e",
80 | "hovered_bg": "#55595e"
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/data/themes/image_load_app_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "10",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/data/themes/image_loading_test.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rectangle",
7 | "border_width": "1",
8 | "shadow_width": "2"
9 | }
10 | },
11 | "#1":
12 | {
13 | "images":
14 | {
15 | "normal_image": {
16 | "package": "data.images.space",
17 | "resource": "space_1.jpg"
18 | }
19 | }
20 | },
21 | "#2":
22 | {
23 | "images":
24 | {
25 | "normal_image": {
26 | "package": "data.images.space",
27 | "resource": "space_2.jpg"
28 | }
29 | }
30 | },
31 | "#3":
32 | {
33 | "images":
34 | {
35 | "normal_image": {
36 | "package": "data.images.space",
37 | "resource": "space_3.jpg"
38 | }
39 | }
40 | },
41 | "#4":
42 | {
43 | "images":
44 | {
45 | "normal_image": {
46 | "package": "data.images.space",
47 | "resource": "space_4.jpg"
48 | }
49 | }
50 | },
51 | "#5":
52 | {
53 | "images":
54 | {
55 | "normal_image": {
56 | "package": "data.images.space",
57 | "resource": "space_5.jpg"
58 | }
59 | }
60 | },
61 | "#6":
62 | {
63 | "images":
64 | {
65 | "normal_image": {
66 | "package": "data.images.space",
67 | "resource": "space_6.jpg"
68 | }
69 | }
70 | },
71 | "#7":
72 | {
73 | "images":
74 | {
75 | "normal_image": {
76 | "package": "data.images.space",
77 | "resource": "space_7.jpg"
78 | }
79 | }
80 | },
81 | "#8":
82 | {
83 | "images":
84 | {
85 | "normal_image": {
86 | "package": "data.images.space",
87 | "resource": "space_8.jpg"
88 | }
89 | }
90 | },
91 | "#9":
92 | {
93 | "images":
94 | {
95 | "normal_image": {
96 | "package": "data.images.space",
97 | "resource": "space_9.jpg"
98 | }
99 | }
100 | },
101 | "#10":
102 | {
103 | "images":
104 | {
105 | "normal_image": {
106 | "package": "data.images.space",
107 | "resource": "space_10.jpg"
108 | }
109 | }
110 | },
111 | "#11":
112 | {
113 | "images":
114 | {
115 | "normal_image": {
116 | "package": "data.images.space",
117 | "resource": "space_11.jpg"
118 | }
119 | }
120 | },
121 | "#12":
122 | {
123 | "images":
124 | {
125 | "normal_image": {
126 | "package": "data.images.space",
127 | "resource": "space_12.jpg"
128 | }
129 | }
130 | },
131 | "#13":
132 | {
133 | "images":
134 | {
135 | "normal_image": {
136 | "package": "data.images.space",
137 | "resource": "space_13.jpg"
138 | }
139 | }
140 | },
141 | "#14":
142 | {
143 | "images":
144 | {
145 | "normal_image": {
146 | "package": "data.images.space",
147 | "resource": "space_14.jpg"
148 | }
149 | }
150 | },
151 | "#15":
152 | {
153 | "images":
154 | {
155 | "normal_image": {
156 | "package": "data.images.space",
157 | "resource": "space_15.jpg"
158 | }
159 | }
160 | },
161 | "#16":
162 | {
163 | "images":
164 | {
165 | "normal_image": {
166 | "package": "data.images.space",
167 | "resource": "space_16.jpg"
168 | }
169 | }
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/data/themes/notepad_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "text_box":
3 | {
4 | "misc":
5 | {
6 | "border_width": "0",
7 | "shadow_width": "0"
8 | },
9 | "colours":
10 | {
11 | "text_cursor": "white"
12 | }
13 | },
14 | "text_entry_box":
15 | {
16 | "misc":
17 | {
18 | "border_width": "0",
19 | "shadow_width": "0"
20 | },
21 | "colours":
22 | {
23 | "text_cursor": "white"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/data/themes/pyinstaller_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "10",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | },
11 | "images":
12 | {
13 | "normal_image": {
14 | "path": "data/images/splat.png",
15 | "sub_surface_rect": "0,0,32,32"
16 | },
17 | "hovered_image": {
18 | "path": "data/images/splat.png",
19 | "sub_surface_rect": "32,0,32,32"
20 | }
21 | },
22 | "font":
23 | {
24 | "name": "montserrat",
25 | "size": "12",
26 | "bold": "1",
27 | "italic": "0",
28 | "regular_path": "data/fonts/Montserrat-Regular.ttf",
29 | "bold_path": "data/fonts/Montserrat-Bold.ttf",
30 | "italic_path": "data/fonts/Montserrat-Italic.ttf",
31 | "bold_italic_path": "data/fonts/Montserrat-BoldItalic.ttf"
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/data/themes/quick_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button":
3 | {
4 | "misc":
5 | {
6 | "shape": "rounded_rectangle",
7 | "shape_corner_radius": "10",
8 | "border_width": "1",
9 | "shadow_width": "2"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/data/themes/status_bar_theme.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "#progress_bar":
4 | {
5 | "colours": {
6 | "filled_bar": "#D0E0FF,#90A0B0,-90",
7 | "unfilled_bar": "#606060"
8 | },
9 | "misc": {
10 | "shape": "rounded_rectangle",
11 | "shape_corner_radius": "12"
12 | }
13 | },
14 |
15 | "@player_status_bars":
16 | {
17 | "misc":
18 | {
19 | "shadow_width": "1",
20 | "border_width": "0"
21 | }
22 | },
23 |
24 | "#health_bar":
25 | {
26 | "colours": {
27 | "filled_bar": "#AA4040D0",
28 | "unfilled_bar": "#888888D0"
29 | },
30 | "misc":
31 | {
32 | "follow_sprite_offset": "-14,-20"
33 | }
34 | },
35 | "#mana_bar":
36 | {
37 | "colours": {
38 | "filled_bar": "#6666AAD0",
39 | "unfilled_bar": "#888888D0"
40 | },
41 | "misc":
42 | {
43 | "follow_sprite_offset": "-14,-14"
44 | }
45 | },
46 | "#stamina_bar":
47 | {
48 | "colours": {
49 | "filled_bar": "#77CC77D0",
50 | "unfilled_bar": "#888888D0"
51 | },
52 | "misc":
53 | {
54 | "follow_sprite_offset": "-14,-8"
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/data/themes/text_effects_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "label":
3 | {
4 | "colours":{
5 | "dark_bg": "#550000ff"
6 | }
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/data/themes/theme_1.json:
--------------------------------------------------------------------------------
1 | {
2 | "text_box":
3 | {
4 | "colours":
5 | {
6 | "link_text":"#F080E0,#8080E0,0",
7 | "link_hover":"#FF8FEF",
8 | "regular_text": "#D0D0D0,#FFFFFF,#D050FF,90"
9 | },
10 | "misc":
11 | {
12 | "shape": "rounded_rectangle",
13 | "shape_corner_radius": "10",
14 | "border_width": "1",
15 | "padding": "10,10",
16 | "link_normal_underline": "0",
17 | "link_hover_underline": "0",
18 | "line_spacing": "0.9"
19 |
20 | }
21 | },
22 | "text_box.vertical_scroll_bar":
23 | {
24 | "misc":
25 | {
26 | "shape": "rounded_rectangle",
27 | "shape_corner_radius": "9"
28 | }
29 | },
30 | "text_box.vertical_scroll_bar.button":
31 | {
32 | "misc":
33 | {
34 | "shape": "rounded_rectangle",
35 | "shape_corner_radius": "7"
36 | }
37 | },
38 |
39 | "@white_text_box":
40 | {
41 | "colours":
42 | {
43 | "dark_bg":"#EEEFEF",
44 | "normal_border": "#884422"
45 | },
46 |
47 | "misc":
48 | {
49 | "border_width": "6",
50 | "padding": "5,5"
51 |
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/data/themes/theme_2.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults":
3 | {
4 | "colours":
5 | {
6 | "normal_bg": "#fb9e91",
7 | "hovered_bg": "#fbda91",
8 | "disabled_bg": "#cb6e61",
9 | "selected_bg": "#fb0091",
10 | "dark_bg": "#fb8691",
11 | "disabled_dark_bg": "#db6671",
12 | "normal_text": "#202020",
13 | "hovered_text": "#303030",
14 | "selected_text": "#404040",
15 | "disabled_text": "#000000",
16 | "link_text": "#0000EE",
17 | "link_hover": "#2020FF",
18 | "link_selected": "#551A8B",
19 | "text_shadow": "#777777",
20 | "normal_border": "#ffB2A5",
21 | "hovered_border": "#ffC2B5",
22 | "disabled_border": "#Df9285",
23 | "selected_border": "#ff00A1",
24 | "filled_bar": "#f4251b",
25 | "unfilled_bar": "#CCCCCC"
26 | }
27 | },
28 |
29 | "#test_prototype_colours":
30 | {
31 | "colours":
32 | {
33 | "dark_bg": "#fb86fb,#fd92A0,180",
34 | "normal_border": "#ffB2A5",
35 | "normal_bg": "#fb9e91"
36 | }
37 | },
38 |
39 | "#test_prototype_font":
40 | {
41 | "font":
42 | {
43 | "name": "montserrat",
44 | "size": "12",
45 | "bold": "1",
46 | "italic": "0",
47 | "regular_resource": { "package": "data.fonts", "resource": "Montserrat-Regular.ttf"},
48 | "bold_resource": { "package": "data.fonts", "resource": "Montserrat-Bold.ttf"},
49 | "italic_resource": { "package": "data.fonts", "resource": "Montserrat-Italic.ttf"},
50 | "bold_italic_resource": { "package": "data.fonts", "resource": "Montserrat-BoldItalic.ttf"}
51 | }
52 | },
53 |
54 | "#test_prototype_image":
55 | {
56 | "images":
57 | {
58 | "normal_image": {
59 | "package": "data.images",
60 | "resource": "splat.bmp",
61 | "sub_surface_rect": "0,0,32,32"
62 | },
63 | "hovered_image": {
64 | "package": "data.images",
65 | "resource": "splat.bmp",
66 | "sub_surface_rect": "32,0,32,32"
67 | }
68 | }
69 | },
70 |
71 | "horizontal_slider":
72 | {
73 | "prototype": "#test_prototype_colours",
74 |
75 | "colours":
76 | {
77 | "dark_bg": "#fb86fb,#fd92A0,90"
78 | },
79 | "misc":
80 | {
81 | "enable_arrow_buttons": "1"
82 | }
83 | },
84 | "horizontal_slider.@arrow_button": {
85 | "misc":
86 | {
87 | "shape": "rectangle",
88 | "shape_corner_radius": "0",
89 | "padding": "0,0",
90 | "shadow_width": "0",
91 | "border_width": "0",
92 | "text_vert_alignment_padding": "0"
93 | }
94 | },
95 | "vertical_scroll_bar":
96 | {
97 | "colours":
98 | {
99 | "selected_bg": "#fb9e91",
100 | "dark_bg": "#fb8691"
101 | }
102 | },
103 |
104 | "tool_tip.text_box":
105 | {
106 | "colours":
107 | {
108 | "dark_bg": "#fb9e91B0"
109 | },
110 | "misc":
111 | {
112 | "shape": "rounded_rectangle",
113 | "shape_corner_radius": "10",
114 | "padding": "8,8"
115 | }
116 | },
117 |
118 | "#hover_me_button":
119 | {
120 | "prototype": "#test_prototype_image",
121 |
122 | "misc":
123 | {
124 | "shape": "rounded_rectangle",
125 | "shape_corner_radius": "18",
126 | "shadow_width": "2",
127 | "border_width": "1",
128 | "state_transitions":
129 | {
130 | "normal_hovered": "0.2",
131 | "hovered_normal": "0.5"
132 | }
133 | }
134 | },
135 |
136 | "#everything_button":
137 | {
138 | "prototype": "#test_prototype_image",
139 |
140 | "colours":
141 | {
142 | "normal_border": "#ffB2A5",
143 | "normal_text": "#FFFFFF,#FFA0A0,90"
144 | },
145 | "misc":
146 | {
147 | "shape": "ellipse",
148 | "shadow_width": "2",
149 | "border_width": "1"
150 | }
151 | },
152 |
153 | "text_entry_line":
154 | {
155 | "prototype": "#test_prototype_font",
156 | "colours":
157 | {
158 | "selected_bg": "#fb0091A0,#20fdA0A0,0",
159 | "normal_text": "#FFFFFF,#FFA0A0,90",
160 | "selected_text": "#FFFFFF,#A0A0FF,90",
161 | "text_cursor": "#A0A0FF"
162 | },
163 | "misc":
164 | {
165 | "shape": "rounded_rectangle",
166 | "shape_corner_radius": "10",
167 | "border_width": "1",
168 | "padding": "2,0"
169 | }
170 | },
171 |
172 | "#drop_down_shape_prototype": {
173 | "misc": {
174 | "shape": "rounded_rectangle",
175 | "shape_corner_radius": "4"
176 | }
177 | },
178 | "#drop_down_text_prototype":
179 | {
180 | "font":
181 | {
182 | "name": "montserrat",
183 | "size": "12",
184 | "bold": "0",
185 | "italic": "1",
186 | "regular_resource": { "package": "data.fonts", "resource": "Montserrat-Regular.ttf"},
187 | "bold_resource": { "package": "data.fonts", "resource": "Montserrat-Bold.ttf"},
188 | "italic_resource": { "package": "data.fonts", "resource": "Montserrat-Italic.ttf"},
189 | "bold_italic_resource": { "package": "data.fonts", "resource": "Montserrat-BoldItalic.ttf"}
190 |
191 | }
192 | },
193 | "drop_down_menu":
194 | {
195 | "prototype": "#drop_down_shape_prototype",
196 |
197 | "colours":
198 | {
199 | "dark_bg": "#fb9e91",
200 | "normal_border": "#FFB0B0,#FFB0FF,0"
201 | },
202 | "misc":
203 | {
204 | "shadow_width": "2",
205 | "border_width": "1",
206 | "expand_direction": "up",
207 | "open_button_width": "0"
208 | }
209 | },
210 |
211 | "drop_down_menu.#drop_down_options_list":
212 | {
213 | "prototype": "#drop_down_shape_prototype",
214 |
215 | "misc":
216 | {
217 | "shadow_width": "2",
218 | "border_width": "1"
219 | }
220 | },
221 |
222 | "drop_down_menu.#drop_down_options_list.vertical_scroll_bar":
223 | {
224 | "misc":
225 | {
226 | "shadow_width": "0",
227 | "border_width": "1",
228 | "enable_arrow_buttons": "0"
229 | }
230 | },
231 |
232 | "drop_down_menu.#drop_down_options_list.button":
233 | {
234 | "prototype": "#drop_down_shape_prototype",
235 | "prototype": "#drop_down_text_prototype",
236 |
237 | "misc":
238 | {
239 | "shadow_width": "0",
240 | "border_width": "0",
241 |
242 | "state_transitions":
243 | {
244 | "normal_hovered": "0.2",
245 | "hovered_normal": "0.5"
246 | }
247 | }
248 | },
249 |
250 | "drop_down_menu.button":
251 | {
252 | "prototype": "#drop_down_shape_prototype",
253 | "prototype": "#drop_down_text_prototype",
254 |
255 | "misc":
256 | {
257 | "shadow_width": "0",
258 | "border_width": "0",
259 | "state_transitions":
260 | {
261 | "normal_hovered": "0.2",
262 | "hovered_normal": "0.5"
263 | }
264 | }
265 | },
266 |
267 | "screen_space_health_bar":
268 | {
269 | "colours":
270 | {
271 | "normal_text": "#FFFFFF"
272 | }
273 | },
274 |
275 | "#base_window":
276 | {
277 | "misc":
278 | {
279 | "border_width": "8"
280 | }
281 | },
282 |
283 | "#scaling_window":
284 | {
285 | "prototype": "#base_window",
286 | "misc":
287 | {
288 | "shadow_width": "1"
289 | }
290 | },
291 |
292 | "#everything_window.horizontal_slider":
293 | {
294 | "colours":
295 | {
296 | "dark_bg": "#fb8691,#fd92A0,180",
297 | "normal_border": "#ffB2A5",
298 | "normal_bg": "#fb9e91"
299 | },
300 | "misc":
301 | {
302 | "shape": "rounded_rectangle",
303 | "border_width": "2",
304 | "shadow_width": "1",
305 | "enable_arrow_buttons": "1"
306 | }
307 | },
308 | "#everything_window.horizontal_slider.#sliding_button":
309 | {
310 | "misc":
311 | {
312 | "shape": "ellipse",
313 | "border_width": "1",
314 | "shadow_width": "1"
315 | }
316 | },
317 | "#everything_window.#title_bar":
318 | {
319 | "font":
320 | {
321 | "name": "montserrat",
322 | "size": "12",
323 | "bold": "0",
324 | "italic": "1",
325 | "regular_resource": { "package": "data.fonts", "resource": "Montserrat-Regular.ttf"},
326 | "bold_resource": { "package": "data.fonts", "resource": "Montserrat-Bold.ttf"},
327 | "italic_resource": { "package": "data.fonts", "resource": "Montserrat-Italic.ttf"},
328 | "bold_italic_resource": { "package": "data.fonts", "resource": "Montserrat-BoldItalic.ttf"}
329 | },
330 | "misc":
331 | {
332 | "text_horiz_alignment": "left"
333 | }
334 | },
335 | "#everything_window.label":
336 | {
337 | "colours":
338 | {
339 | "normal_text": "#0091fbFF,#20fdA0FF,90",
340 | "text_shadow": "#10101070"
341 | },
342 | "misc":
343 | {
344 | "text_shadow_size": "1",
345 | "text_shadow_offset": "0,0"
346 | }
347 | },
348 | "#everything_window.screen_space_health_bar":
349 | {
350 | "colours":
351 | {
352 | "normal_text": "#FFFFFF",
353 | "filled_bar": "#0091fbAA,#2060A0AA,90",
354 | "unfilled_bar": "#FF505090"
355 | },
356 | "misc":
357 | {
358 | "shadow_width": "1"
359 | }
360 | },
361 | "#everything_window.text_entry_line":
362 | {
363 | "prototype": "#test_prototype_font",
364 | "misc":
365 | {
366 | "text_horiz_alignment_padding": "2",
367 | "text_horiz_alignment": "left"
368 | }
369 | },
370 |
371 | "panel":
372 | {
373 | "images":
374 | {
375 | "background_image":
376 | {
377 | "package": "data.images",
378 | "resource": "splat.bmp",
379 | "sub_surface_rect": "0,0,32,32"
380 | }
381 | }
382 | },
383 | "#fps_counter":
384 | {
385 | "colours":
386 | {
387 | "normal_text": "#FFFFFF",
388 | "dark_bg": "#fb8691"
389 | },
390 | "font":
391 | {
392 | "name": "noto_sans",
393 | "size": "32"
394 | }
395 | },
396 | "#frame_timer":
397 | {
398 | "colours":
399 | {
400 | "normal_text": "#FFFFFF",
401 | "dark_bg": "#00000000"
402 | },
403 | "font":
404 | {
405 | "name": "noto_sans",
406 | "size": "14"
407 | }
408 | }
409 | }
410 |
--------------------------------------------------------------------------------
/data/themes/theme_3.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "colours": {
4 | "normal_bg": "#91fb91",
5 | "hovered_bg": "#BBffBB",
6 | "disabled_bg": "#cb6e61",
7 | "selected_bg": "#40B040",
8 | "active_bg": "#409040",
9 | "dark_bg": "#86fb91",
10 | "normal_text": "#202020",
11 | "hovered_text": "#303030",
12 | "selected_text": "#404040",
13 | "disabled_text": "#000000",
14 | "normal_border": "#71db71"
15 | }
16 | },
17 | "window":
18 | {
19 | "misc":
20 | {
21 | "shape": "rounded_rectangle",
22 | "shape_corner_radius": "10,10,0,0"
23 | }
24 | },
25 | "window.#title_bar":
26 | {
27 | "misc":
28 | {
29 | "shape": "rounded_rectangle",
30 | "shape_corner_radius": "10,0,0,0"
31 | }
32 | },
33 | "window.#close_button":
34 | {
35 | "misc":
36 | {
37 | "shape": "rounded_rectangle",
38 | "shape_corner_radius": "0,10,0,0"
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/data/themes/translations_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "label":
3 | {
4 | "font":
5 | [
6 | {
7 | "name": "montserrat",
8 | "size": "16",
9 | "bold": "0",
10 | "italic": "0",
11 | "regular_resource": {"package": "data.fonts",
12 | "resource": "Montserrat-Regular.ttf"}
13 | },
14 | {
15 | "name": "kosugimaru",
16 | "locale": "ja",
17 | "size": "16",
18 | "bold": "0",
19 | "italic": "0",
20 | "regular_resource": {"package": "data.fonts",
21 | "resource": "KosugiMaru-Regular.ttf"}
22 | },
23 | {
24 | "name": "amiri",
25 | "locale": "ar",
26 | "size": "16",
27 | "bold": "0",
28 | "italic": "0",
29 | "regular_resource": {"package": "data.fonts",
30 | "resource": "Amiri-Regular.ttf"}
31 | },
32 | {
33 | "name": "noto_rashi",
34 | "locale": "he",
35 | "size": "24",
36 | "bold": "0",
37 | "italic": "0",
38 | "regular_resource": {"package": "data.fonts",
39 | "resource": "NotoRashiHebrew-Regular.ttf"}
40 | },
41 | {
42 | "name": "song_myung",
43 | "locale": "ko",
44 | "size": "24",
45 | "bold": "0",
46 | "italic": "0",
47 | "regular_resource": {"package": "data.fonts",
48 | "resource": "SongMyung-Regular.ttf"}
49 | },
50 | {
51 | "name": "ma_shan_zhang",
52 | "locale": "zh",
53 | "size": "24",
54 | "bold": "0",
55 | "italic": "0",
56 | "regular_resource": {"package": "data.fonts",
57 | "resource": "MaShanZheng-Regular.ttf"}
58 | },
59 | {
60 | "name": "noto_serif_georgian",
61 | "locale": "ge",
62 | "size": "24",
63 | "bold": "0",
64 | "italic": "0",
65 | "regular_resource": {"package": "data.fonts",
66 | "resource": "NotoSerifGeorgian-Regular.ttf"}
67 | }
68 | ]
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/data/themes/two_sided_border_theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "button": {
3 | "colours": {
4 | "normal_bg": "#45494e",
5 | "hovered_bg": "#35393e",
6 | "disabled_bg": "#25292e",
7 | "selected_bg": "#193754",
8 | "active_bg": "#193754",
9 | "normal_text": "#FFFFFF",
10 | "hovered_text": "#FFFFFF",
11 | "selected_text": "#FFFFFF",
12 | "disabled_text": "#6d736f",
13 | "active_text": "#FFFFFF",
14 | "normal_border": "#AAAAAA",
15 | "hovered_border": "#FFFFFF",
16 | "disabled_border": "#808080",
17 | "selected_border": "#8080B0",
18 | "active_border": "#8080B0"
19 | },
20 | "misc": {
21 | "border_width": {
22 | "left": 0,
23 | "right": 2,
24 | "top": 1,
25 | "bottom": 3
26 | },
27 | "shadow_width": 2,
28 | "shape": "rectangle"
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/data/translations/examples.ar.json:
--------------------------------------------------------------------------------
1 | {
2 | "ar": {
3 | "holmes_text_test": "
كان السيد شيرلوك هولمز، الذي عادة ما يصل متأخرًا جدًا في الصباح، باستثناء المناسبات غير المتكررة التي كان يستيقظ فيها طوال الليل، يجلس على مائدة الإفطار. وقفت على بساط المدفأة والتقطت العصا التي تركها زائرنا خلفه في الليلة السابقة. لقد كانت قطعة خشب سميكة وسميكة، ذات رأس منتفخ، من النوع المعروف باسم «محامي بينانج». أسفل الرأس مباشرة كان هناك شريط فضي عريض يبلغ عرضه بوصة واحدة تقريبًا. «إلى جيمس مورتيمر، م.ر.خ.س.، من أصدقائه في خ.خ.ه.،» محفور عليها التاريخ «1884». لقد كانت مجرد عصا كان يحملها ممارس الأسرة من الطراز القديم - كريمة وصلبة ومطمئنة.
", 4 | "hello_world_message_text": "مرحبا بالعالم" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.de.json: -------------------------------------------------------------------------------- 1 | { 2 | "de": { 3 | "holmes_text_test": "Mr. Sherlock Holmes, der morgens sehr spät aufzustehen pfl egte – wenn man einmal von jenen nicht seltenen Gelegenheiten absah, da er die ganze Nacht aufblieb –, saß am Frühstückstisch, während ich auf dem Kaminvorleger stand und den Spazierstock aufhob, den unser Besucher vergangene Nacht vergessen hatte. Es handelte sich um ein schönes, stabiles Stück Holz mit einem knollenförmigen Griff derjenigen Sorte, die bei uns unter dem Namen „Penang-Anwalt“ bekannt ist. Gleich unterhalb des Griffes war ein gut zwei Zentimeter breites Silberband befestigt, auf welchem die Widmung „Für James Mortimer, M. R. C. S., von seinen Freunden des C. C. H.“ eingraviert war, datiert auf das Jahr 1884; ein Stock, gerade wie ihn ein altmodischer Hausarzt getragen hätte: würdevoll, solide und zuverlässig.
", 4 | "hello_world_message_text": "Hallo Welt" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "en": { 3 | "holmes_text_test": "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table. I stood upon the hearth-rug and picked up the stick which our visitor had left behind him the night before. It was a fine, thick piece of wood, bulbous-headed, of the sort which is known as a “Penang lawyer.” Just under the head was a broad silver band nearly an inch across. “To James Mortimer, M.R.C.S., from his friends of the C.C.H.,” was engraved upon it, with the date “1884.” It was just such a stick as the old-fashioned family practitioner used to carry—dignified, solid, and reassuring.
", 4 | "hello_world_message_text": "Hello world" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "es": { 3 | "holmes_text_test": "El señor Sherlock Holmes, que de ordinario se levantaba muy tarde, excepto en las ocasiones nada infrecuentes en que no se acostaba en toda la noche, estaba desayunando. Yo, que me hallaba de pie junto a la chimenea, me agaché para recoger el bastón olvidado por nuestro visitante de la noche anterior. Sólido, de madera de buena calidad y con un abultamiento a modo de empuñadura, era del tipo que se conoce como «abogado de Penang». Inmediatamente debajo de la protuberancia el bastón llevaba una ancha tira de plata, de más de dos centímetros, en la que estaba grabado «A James Mortimer, M.R.C.S., de sus amigos de C.C.H.», y el año, « 1884». Era exactamente la clase de bastón que solían llevar los médicos de cabecera a la antigua usanza: digno, sólido y que inspiraba confianza.
", 4 | "hello_world_message_text": "Hola Mundo" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "fr": { 3 | "holmes_text_test": "Ce matin-là, M. Sherlock Holmes qui, sauf les cas assez fréquents où il passait les nuits, se levait tard, était assis devant la table de la salle à manger. Je me tenais près de la cheminée, examinant la canne que notre visiteur de la veille avait oubliée. C’était un joli bâton, solide, terminé par une boule — ce qu’on est convenu d'appeler « une permission de minuit ». Immédiatement au-dessous de la pomme, un cercle d’or, large de deux centimètres, portait l’inscription et la date suivantes : « À M. James Mortimer, ses amis du C. C. H. — 1884 ». Cette canne, digne, grave, rassurante, ressemblait à celles dont se servent les médecins « vieux jeu ».
", 4 | "hello_world_message_text": "Bonjour le monde" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.ge.json: -------------------------------------------------------------------------------- 1 | { 2 | "ge": { 3 | "holmes_text_test": "No translation found yet.
", 4 | "hello_world_message_text": "Გამარჯობა მსოფლიო" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.he.json: -------------------------------------------------------------------------------- 1 | { 2 | "he": { 3 | "holmes_text_test": "מר שרלוק הולמס, שבדרך כלל איחר מאוד בבקרים, מלבד אותם מקרים לא נדירים שבהם היה ער כל הלילה, ישב ליד שולחן ארוחת הבוקר. עמדתי על שטיח האח והרמתי את המקל שהאורח שלנו השאיר מאחוריו בלילה הקודם. זה היה חתיכת עץ עדינה ועבה, בעלת ראש בולבי, מהסוג שמכונה עורך דין פנאנג. ממש מתחת לראש הייתה רצועת כסף רחבה בקוטר של כמעט סנטימטר. לג'יימס מורטימר, M.R.C.S., מחבריו ל-C.C.H., נחקק עליו, עם התאריך 1884. זה היה בדיוק מקל כזה שהמתרגל המשפחתי המיושן נהג לשאת מכובד, מוצק ומרגיע.
", 4 | "hello_world_message_text": "שלום עולם" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.id.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": { 3 | "holmes_text_test": "No translation found yet.
", 4 | "hello_world_message_text": "Halo Dunia" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.it.json: -------------------------------------------------------------------------------- 1 | { 2 | "it": { 3 | "holmes_text_test": "Sherlock Holmes, che olitamente si alzava molto tardi alla mattina - tranne i molto frequenti casi in cui rimaneva in piedi tutta la notte - era seduto al tavolo della prima colazione. Io mi ero chinato sulla stuoia distesa accanto al caminetto e avevo raccolto il bastone da passeggio dimenticato dal nostro ospite della sera prima. Era un bellissimo esemplare di solido legno, dall'impugnatura a bulbo del tipo noto col nome di \"Penang lawyer\". Proprio al disotto del pomo c’era una grossa striscia d'argento, larga quasi un pollice. Vi era inciso sopra: \"A James Mortimer, M.R.C.S., da parte dei suoi amici del C.C.H.\", con data \"1884\". Era proprio il tipo di bastone da passeggio che sono soliti portare i medici di famiglia all'antica: era dignitoso, massiccio, ispirava fiducia.
", 4 | "hello_world_message_text": "Ciao mondo" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "ja": { 3 | "holmes_text_test": "No translation found yet.
", 4 | "hello_world_message_text": "こんにちは世界" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "ko": { 3 | "holmes_text_test": "미스터. 밤새도록 깨어 있는 경우를 제외하고는 대개 아침에 아주 늦게 도착하는 셜록 홈즈가 아침 식탁에 앉아 있었습니다. 나는 난로 깔개 위에 서서 방문객이 전날 밤에 두고 간 막대기를 집어들었습니다. 그것은 '페낭 변호사'로 알려진 종류의 가늘고 두꺼운 나무 조각으로 머리가 둥그스름했습니다. 머리 바로 아래에는 약 1인치 너비의 넓은 은색 띠가 있었습니다. “C.C.H.의 친구인 M.R.C.S. 제임스 모티머에게” 그 위에는 '1884년'이라는 날짜가 새겨져 있었습니다. 그것은 옛날 가정의가 들고 다니던 막대기와도 같았고, 위엄 있고 견고하며 안심이 되었습니다.
", 4 | "hello_world_message_text": "안녕 세상아" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "pl": { 3 | "holmes_text_test": "Pan Sherlock Holmes, który zwykle wstawał bardzo późno, z wyjątkiem nierzadkich okazji, kiedy nie spał całą noc, siedział przy stole śniadaniowym. Stałem na dywaniku przy kominku i podniosłem kij, który nasz gość zostawił za sobą poprzedniego wieczoru. Był to cienki, gruby kawałek drewna z bulwiastą głową, z rodzaju znanego jako prawnik z Penang. Tuż pod głową znajdowała się szeroka srebrna opaska o średnicy prawie cala. Do Jamesa Mortimera, M.R.C.S., od jego przyjaciół z C.C.H. był na nim wygrawerowany, z datą 1884. Był to właśnie taki kij, jaki staromodny lekarz rodzinny niósł z godnością, solidnością i pociechą.
", 4 | "hello_world_message_text": "Witaj świecie" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "pt": { 3 | "holmes_text_test": "No translation found yet.
", 4 | "hello_world_message_text": "Olá Mundo" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "ru": { 3 | "holmes_text_test": "Мистер Шерлок Холмс сидел за столом и завтракал. Обычно он вставал довольно поздно, если не считать тех нередких случаев, когда ему вовсе не приходилось ложиться. Я стоял на коврике у камина и вертел в руках палку, забытую нашим вчерашним посетителем, хорошую толстую палку с набалдашником - из тех, что именуются \"веским доказательством\". Чуть ниже набалдашника было врезано серебряное кольцо шириной около дюйма. На кольце было начертано: \"Джеймсу Мортимеру, Ч. К. X. О., от его друзей по ЧКЛ\" и дата: \"1884\". В прежние времена с такими палками - солидными, увесистыми, надежными - ходили почтенные домашние врачи.
", 4 | "hello_world_message_text": "Привет мир" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "uk": { 3 | "holmes_text_test": "Містер Шерлок Холмс, який вставав, як правило, дуже пізно, за винятком тих досить численних випадків, коли не лягав спати зовсім, сидів за столом і снідав. Я стояв на килимку біля каміна й крутив у руках ціпок, що його напередодні ввечері забув наш відвідувач. Це був гарний, з чималою головкою, дебелий ціпок — з тих, що відомі під назвою «ломака». Під головкою ціпок охоплювало срібне кільце завширшки майже в дюйм. На ньому було вигравірувано: «Джеймсові Мортімеру, Ч.К.Х.Т., від його друзів по ЧКЛ» і рік «1884». З такими ціпками-палицями — показними, масивними й надійними — мали за звичай ходити старомодні домашні лікарі.
", 4 | "hello_world_message_text": "Привіт Світ" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "vi": { 3 | "holmes_text_test": "No translation found yet.
", 4 | "hello_world_message_text": "Chào thế giới" 5 | } 6 | } -------------------------------------------------------------------------------- /data/translations/examples.zh.json: -------------------------------------------------------------------------------- 1 | { 2 | "zh": { 3 | "holmes_text_test": "歇洛克·福尔摩斯先生坐在桌旁早餐,他除了时常彻夜不眠之外,早晨总是起得很晚的。我站在壁炉前的小地毯上,拿起了昨晚那位客人遗忘的手杖。这是一根很精致而又沉重的手杖,顶端有个疙疸;这种木料产于槟榔屿,名叫槟榔子木。紧挨顶端的下面是一圈很宽的银箍,宽度约有一英寸。上刻“送给皇家外科医学院学士杰姆士·摩梯末,C.C.H.的朋友们赠”,还刻有“一八八四年”。这不过是一根旧式的私人医生所常用的那种既庄重、坚固而又实用的手杖。
", 4 | "hello_world_message_text": "你好世界" 5 | } 6 | } -------------------------------------------------------------------------------- /docs/example_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyreMylar/pygame_gui_examples/75ba91f92be3b0fe9396e3c6ec184293bc17bd0c/docs/example_1.png -------------------------------------------------------------------------------- /documentation_test.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import pygame_gui 3 | 4 | 5 | """ 6 | Useful example for building documentation images 7 | """ 8 | 9 | 10 | class TestSprite(pygame.sprite.Sprite): 11 | def __init__(self, *groups): 12 | super().__init__(*groups) 13 | self.health_capacity = 100 14 | self.current_health = 75 15 | self.rect = pygame.Rect(150, 150, 50, 75) 16 | 17 | 18 | pygame.init() 19 | 20 | pygame.display.set_caption('Quick Start') 21 | window_surface = pygame.display.set_mode((800, 600)) 22 | manager = pygame_gui.UIManager((800, 600), 'data/themes/documentation_theme.json') 23 | 24 | background = pygame.Surface((800, 600)) 25 | background.fill(pygame.Color('#fcfcfc')) 26 | 27 | # pygame_gui.elements.UIDropDownMenu(options_list=['Easy', 'Medium', 'Hard', 'Very Hard'], 28 | # starting_option='Medium', 29 | # relative_rect=pygame.Rect((350, 280), (250, 50)), 30 | # manager=manager) 31 | 32 | # pygame_gui.elements.UIHorizontalSlider(relative_rect=pygame.Rect((350, 280), (250, 40)), 33 | # start_value=50, 34 | # value_range=(0, 100), 35 | # manager=manager) 36 | 37 | # pygame_gui.elements.UILabel(relative_rect=pygame.Rect((350, 280), (350, 60)), 38 | # text='label text', 39 | # manager=manager) 40 | 41 | # pygame_gui.elements.UIScreenSpaceHealthBar(relative_rect=pygame.Rect((350, 280), (250, 40)), 42 | # manager=manager) 43 | 44 | # pygame_gui.elements.UITextBox(html_text="This is normal text. This a link", 45 | # relative_rect=pygame.Rect((150, 150), (150, 100)), 46 | # manager=manager) 47 | 48 | # pygame_gui.elements.UITextEntryLine(relative_rect=pygame.Rect((350, 280), (250, 40)), 49 | # manager=manager) 50 | 51 | # pygame_gui.elements.UIVerticalScrollBar(relative_rect=pygame.Rect((280, 150), (30, 250)), 52 | # visible_percentage=0.8, 53 | # manager=manager) 54 | 55 | # test_sprite = TestSprite() 56 | # pygame_gui.elements.UIWorldSpaceHealthBar(relative_rect=pygame.Rect((350, 280), (150, 35)), 57 | # sprite_to_monitor=test_sprite, 58 | # manager=manager) 59 | 60 | pygame_gui.windows.UIColourPickerDialog(rect=pygame.Rect(100, 100, 390, 390), 61 | manager=manager) 62 | 63 | clock = pygame.time.Clock() 64 | is_running = True 65 | 66 | while is_running: 67 | time_delta = clock.tick(60)/1000.0 68 | for event in pygame.event.get(): 69 | if event.type == pygame.QUIT: 70 | is_running = False 71 | 72 | manager.process_events(event) 73 | 74 | manager.update(time_delta) 75 | 76 | window_surface.blit(background, (0, 0)) 77 | manager.draw_ui(window_surface) 78 | 79 | pygame.display.update() 80 | -------------------------------------------------------------------------------- /example_auto_scale_button_images.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Example demonstrating the auto_scale_image functionality for UIButton. 4 | 5 | This example shows how to use the new auto_scale_image theming parameter 6 | to automatically scale button images to fit the button size while maintaining 7 | aspect ratio. 8 | """ 9 | 10 | import pygame 11 | import pygame_gui 12 | import json 13 | import os 14 | 15 | 16 | def main(): 17 | # Initialize pygame 18 | pygame.init() 19 | screen = pygame.display.set_mode((1000, 700)) 20 | pygame.display.set_caption("UIButton Auto-Scale Image Example") 21 | clock = pygame.time.Clock() 22 | 23 | # Create theme with auto_scale_image enabled 24 | theme_data = { 25 | "button": { 26 | "misc": { 27 | "auto_scale_images": "1" # Enable auto-scaling 28 | }, 29 | "images": { 30 | "normal_image": { 31 | "path": "data/images/splat.png" 32 | } 33 | } 34 | }, 35 | "#button_no_scale": { 36 | "misc": { 37 | "auto_scale_images": "0" # Disable auto-scaling for comparison 38 | }, 39 | "images": { 40 | "normal_image": { 41 | "path": "data/images/splat.png" 42 | } 43 | } 44 | } 45 | } 46 | 47 | # Save theme to temporary file 48 | theme_file = "auto_scale_theme.json" 49 | with open(theme_file, "w") as f: 50 | json.dump(theme_data, f, indent=2) 51 | 52 | try: 53 | # Create UI manager with the theme 54 | manager = pygame_gui.UIManager((1000, 700), theme_file) 55 | 56 | # Create title 57 | title = pygame_gui.elements.UILabel( 58 | relative_rect=pygame.Rect(10, 10, 980, 40), 59 | text="UIButton Auto-Scale Image Demonstration", 60 | manager=manager 61 | ) 62 | 63 | # Create subtitle for auto-scaled buttons 64 | subtitle1 = pygame_gui.elements.UILabel( 65 | relative_rect=pygame.Rect(10, 60, 480, 30), 66 | text="Auto-Scaled Images (maintains aspect ratio):", 67 | manager=manager 68 | ) 69 | 70 | # Create subtitle for non-scaled buttons 71 | subtitle2 = pygame_gui.elements.UILabel( 72 | relative_rect=pygame.Rect(510, 60, 480, 30), 73 | text="Original Images (no scaling):", 74 | manager=manager 75 | ) 76 | 77 | # Create buttons with auto-scaling enabled 78 | auto_scale_buttons = [] 79 | 80 | # Small square button 81 | small_button = pygame_gui.elements.UIButton( 82 | relative_rect=pygame.Rect(50, 100, 60, 60), 83 | text="Small", 84 | manager=manager 85 | ) 86 | auto_scale_buttons.append(("Small (60x60)", small_button)) 87 | 88 | # Medium square button 89 | medium_button = pygame_gui.elements.UIButton( 90 | relative_rect=pygame.Rect(130, 100, 100, 100), 91 | text="Medium", 92 | manager=manager 93 | ) 94 | auto_scale_buttons.append(("Medium (100x100)", medium_button)) 95 | 96 | # Large square button 97 | large_button = pygame_gui.elements.UIButton( 98 | relative_rect=pygame.Rect(250, 100, 150, 150), 99 | text="Large", 100 | manager=manager 101 | ) 102 | auto_scale_buttons.append(("Large (150x150)", large_button)) 103 | 104 | # Wide rectangular button 105 | wide_button = pygame_gui.elements.UIButton( 106 | relative_rect=pygame.Rect(50, 270, 200, 80), 107 | text="Wide Rectangle", 108 | manager=manager 109 | ) 110 | auto_scale_buttons.append(("Wide (200x80)", wide_button)) 111 | 112 | # Tall rectangular button 113 | tall_button = pygame_gui.elements.UIButton( 114 | relative_rect=pygame.Rect(270, 270, 80, 150), 115 | text="Tall", 116 | manager=manager 117 | ) 118 | auto_scale_buttons.append(("Tall (80x150)", tall_button)) 119 | 120 | # Very small button 121 | tiny_button = pygame_gui.elements.UIButton( 122 | relative_rect=pygame.Rect(370, 270, 30, 30), 123 | text="", 124 | manager=manager 125 | ) 126 | auto_scale_buttons.append(("Tiny (30x30)", tiny_button)) 127 | 128 | # Create buttons without auto-scaling for comparison 129 | no_scale_buttons = [] 130 | 131 | # Small square button (no scaling) 132 | small_button_ns = pygame_gui.elements.UIButton( 133 | relative_rect=pygame.Rect(550, 100, 60, 60), 134 | text="Small", 135 | manager=manager, 136 | object_id="#button_no_scale" 137 | ) 138 | no_scale_buttons.append(("Small (60x60)", small_button_ns)) 139 | 140 | # Medium square button (no scaling) 141 | medium_button_ns = pygame_gui.elements.UIButton( 142 | relative_rect=pygame.Rect(630, 100, 100, 100), 143 | text="Medium", 144 | manager=manager, 145 | object_id="#button_no_scale" 146 | ) 147 | no_scale_buttons.append(("Medium (100x100)", medium_button_ns)) 148 | 149 | # Large square button (no scaling) 150 | large_button_ns = pygame_gui.elements.UIButton( 151 | relative_rect=pygame.Rect(750, 100, 150, 150), 152 | text="Large", 153 | manager=manager, 154 | object_id="#button_no_scale" 155 | ) 156 | no_scale_buttons.append(("Large (150x150)", large_button_ns)) 157 | 158 | # Wide rectangular button (no scaling) 159 | wide_button_ns = pygame_gui.elements.UIButton( 160 | relative_rect=pygame.Rect(550, 270, 200, 80), 161 | text="Wide Rectangle", 162 | manager=manager, 163 | object_id="#button_no_scale" 164 | ) 165 | no_scale_buttons.append(("Wide (200x80)", wide_button_ns)) 166 | 167 | # Tall rectangular button (no scaling) 168 | tall_button_ns = pygame_gui.elements.UIButton( 169 | relative_rect=pygame.Rect(770, 270, 80, 150), 170 | text="Tall", 171 | manager=manager, 172 | object_id="#button_no_scale" 173 | ) 174 | no_scale_buttons.append(("Tall (80x150)", tall_button_ns)) 175 | 176 | # Very small button (no scaling) 177 | tiny_button_ns = pygame_gui.elements.UIButton( 178 | relative_rect=pygame.Rect(870, 270, 30, 30), 179 | text="", 180 | manager=manager, 181 | object_id="#button_no_scale" 182 | ) 183 | no_scale_buttons.append(("Tiny (30x30)", tiny_button_ns)) 184 | 185 | # Create explanation text 186 | explanation = pygame_gui.elements.UITextBox( 187 | relative_rect=pygame.Rect(50, 450, 900, 200), 188 | html_text=""" 189 | Auto-Scale Image Feature: