Skip to content

Commit c1d666f

Browse files
authored
Merge branch 'development' into gui/improvements
2 parents ca8492f + 4d8c653 commit c1d666f

File tree

214 files changed

+8542
-5095
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+8542
-5095
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.10
2+
python: python3.13
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks

CHANGELOG.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,47 @@
33
You can grab pre-release versions from PyPi. See the available versions from the
44
Arcade [PyPi Release History](https://pypi.org/project/arcade/#history) page.
55

6-
## Unreleased
6+
## 3.3.0
77

88
- Fixed an issue causing a crash when closing the window
9-
- Added `Window.close` (bool) attribute indicating if the window is closed
9+
- Added `Window.closed` (bool) attribute indicating if the window is closed
10+
- Fixed an issue where `on_draw` could be dispatched after the window was closed
11+
- Added `PymunkPhysicsEngine.update_sprite` for manually updating a sprite's shape
12+
to synchronize sprite hit boxes with the physics engine
13+
- Fixed an issue causing `on_mouse_leave` to be called from disabled `Section`s
14+
- Various documentation fixes and improvements
15+
- Scene
16+
- `Scene.add_sprite` now returns the added sprite
17+
- `Scene.add_sprite_list` now returns the added sprite list
18+
- `Scene.add_sprite_before` now returns the added sprite list
19+
- `Scene.move_sprite_list_before` now returns the moved sprite list
20+
- `Scene.remove_sprite_list_by_index` now returns the removed sprite list
21+
- `Scene.remove_sprite_list_by_name` now returns the removed sprite list
1022
- GUI
23+
- Fix `UILabel` with enabled multiline sometimes cut off text
24+
- Improved `UIWidget` usability for resizing and positioning:
25+
- Added property setters for `width`, `height`, and `size` that ensure positive values
26+
- Added property setters for `center_x` and `center_y`
27+
- Added property setters for `left`, `right`, `top`, and `bottom`
28+
- Users can now set widget position and size more intuitively without needing to access the `rect` property
1129
- Property listener can now receive:
1230
- no args
1331
- instance
1432
- instance, value
1533
- instance, value, old value
1634
> Listener accepting `*args` receive `instance, value` like in previous versions.
1735
36+
- Rendering:
37+
- The `arcade.gl` package was restructured to be more modular in preparation for
38+
other backends such as WebGL and WebGPU
39+
- Rewrote many shader programs to not use geometry shaders, which are not supported in WebGL
40+
and some other rendering backends
41+
- Fixed a few instances og exceptions not being raised properly in edge cases
42+
- **BREAKING CHANGE**: `SpriteList` now has multiple rendering systems supporting both WebGL and Desktop GL.
43+
If you have customized spritelist rendering you now need to modify the `SpriteListData` instance
44+
on the spritelist accessed through `SpriteList.data`. This instance holds all the GPU-related
45+
resources for the spritelist such as buffers, textures, geometry and shader program.
46+
1847
## Version 3.2
1948

2049
- GUI

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ language.
254254
On Linux distros based on Debian and Ubuntu, you may need to install
255255
the following packages to build PDFs:
256256

257-
``console
257+
```console
258258
sudo apt install latexmk
259259
sudo apt install texlive-latex-extra
260-
``
260+
```
261261
To reduce the large (300 MB+) install size of the second package, you
262262
may be able to use the `--no-install-recommends` flag.
263263

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Welcome to The Arcade Library!
1+
# Welcome to The Arcade Library
22

33
<p align="center">
44
<a href="https://img.shields.io/pypi/l/arcade">
@@ -40,29 +40,29 @@ for example game jam entries and more.
4040

4141
## Stable Documentation
4242

43-
Read the stable documentation at https://api.arcade.academy.
43+
Read the stable documentation at <https://api.arcade.academy>.
4444

4545
## Development Previews
4646

47-
Preview the next release at https://api.arcade.academy/en/development/.
47+
Preview the next release at <https://api.arcade.academy/en/development/>.
4848

4949
## Citation
5050

5151
```
52-
@Online{PythonArcade,
53-
author = {Paul Vincent Craven},
54-
title = {Easy to use Python library for creating 2D Arcade games.},
55-
date = {2023-01-01},
56-
publisher = {GitHub},
57-
journal = {GitHub repository},
58-
howpublished = {\url{https://github.com/pythonarcade/arcade}},
59-
commit = {<insert hash if needed>}
60-
}
52+
@Online{PythonArcade,
53+
author = {Paul Vincent Craven},
54+
title = {Easy to use Python library for creating 2D Arcade games.},
55+
date = {2025-01-01},
56+
publisher = {GitHub},
57+
journal = {GitHub repository},
58+
howpublished = {\url{https://github.com/pythonarcade/arcade}},
59+
commit = {<insert hash if needed>}
60+
}
6161
```
6262

6363
## Contact the Maintainers
6464

6565
The best way to contact and chat with the maintainers is on the
6666
[Arcade Discord Server][].
6767

68-
68+

arcade/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0
1+
3.3.0

arcade/application.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
from arcade.clock import GLOBAL_CLOCK, GLOBAL_FIXED_CLOCK, _setup_clock, _setup_fixed_clock
2323
from arcade.color import BLACK
2424
from arcade.context import ArcadeContext
25+
from arcade.gl.provider import get_arcade_context, set_provider
2526
from arcade.types import LBWH, Color, Rect, RGBANormalized, RGBOrA255
26-
from arcade.utils import is_raspberry_pi
27+
from arcade.utils import is_pyodide, is_raspberry_pi
2728
from arcade.window_commands import get_display_size, set_window
2829

2930
if TYPE_CHECKING:
@@ -157,7 +158,7 @@ def __init__(
157158
center_window: bool = False,
158159
samples: int = 4,
159160
enable_polling: bool = True,
160-
gl_api: str = "gl",
161+
gl_api: str = "opengl",
161162
draw_rate: float = 1 / 60,
162163
fixed_rate: float = 1.0 / 60.0,
163164
fixed_frame_cap: int | None = None,
@@ -167,10 +168,17 @@ def __init__(
167168
if os.environ.get("REPL_ID"):
168169
antialiasing = False
169170

171+
desired_gl_provider = "opengl"
172+
if is_pyodide():
173+
gl_api = "webgl"
174+
175+
if gl_api == "webgl":
176+
desired_gl_provider = "webgl"
177+
170178
# Detect Raspberry Pi and switch to OpenGL ES 3.1
171179
if is_raspberry_pi():
172180
gl_version = 3, 1
173-
gl_api = "gles"
181+
gl_api = "opengles"
174182

175183
self.closed = False
176184
"""Indicates if the window was closed"""
@@ -184,7 +192,7 @@ def __init__(
184192
config = gl.Config(
185193
major_version=gl_version[0],
186194
minor_version=gl_version[1],
187-
opengl_api=gl_api, # type: ignore # pending: upstream fix
195+
opengl_api=gl_api.replace("open", ""), # type: ignore # pending: upstream fix
188196
double_buffer=True,
189197
sample_buffers=1,
190198
samples=samples,
@@ -208,7 +216,7 @@ def __init__(
208216
config = gl.Config(
209217
major_version=gl_version[0],
210218
minor_version=gl_version[1],
211-
opengl_api=gl_api, # type: ignore # pending: upstream fix
219+
opengl_api=gl_api.replace("open", ""), # type: ignore # pending: upstream fix
212220
double_buffer=True,
213221
depth_size=24,
214222
stencil_size=8,
@@ -277,7 +285,9 @@ def __init__(
277285

278286
self.push_handlers(on_resize=self._on_resize)
279287

280-
self._ctx: ArcadeContext = ArcadeContext(self, gc_mode=gc_mode, gl_api=gl_api)
288+
set_provider(desired_gl_provider)
289+
self._ctx: ArcadeContext = get_arcade_context(self, gc_mode=gc_mode, gl_api=gl_api)
290+
# self._ctx: ArcadeContext = ArcadeContext(self, gc_mode=gc_mode, gl_api=gl_api)
281291
self._background_color: Color = BLACK
282292

283293
self._current_view: View | None = None

0 commit comments

Comments
 (0)