Skip to content

Commit 782c652

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/development' into gui/controller
# Conflicts: # arcade/gui/experimental/scroll_area.py
2 parents 4b32537 + dab1e62 commit 782c652

File tree

93 files changed

+819
-620
lines changed

Some content is hidden

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

93 files changed

+819
-620
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
default_language_version:
2-
python: python3.9
2+
python: python3.10
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.5.0
6+
rev: v5.0.0
77
hooks:
88
- id: check-yaml
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.5.0
12+
rev: v0.9.10
1313
hooks:
1414
# Run the linter.
1515
- id: ruff
1616
args: [ --fix ]
1717
# Run the formatter.
1818
- id: ruff-format
1919
- repo: https://github.com/pre-commit/mirrors-mypy
20-
rev: 'v1.10.1'
20+
rev: 'v1.15.0'
2121
hooks:
2222
- id: mypy
2323
args: [ --explicit-package-bases ]
2424
- repo: https://github.com/RobertCraigie/pyright-python
25-
rev: v1.1.370
25+
rev: v1.1.396
2626
hooks:
2727
- id: pyright

CONTRIBUTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ The minium for docstrings is covering all parameters in an `Args:` block.
103103
Args:
104104
width: The width of something
105105
height: The height of something
106-
title (optional): The title of something
106+
title: The title of something
107107
```
108108

109109
* `Args:` should be used for all parameters
@@ -115,7 +115,6 @@ Args:
115115
* `Attributes:` we should try to avoid it and instead document the attributes in the code
116116
* Types are visible in the api docs. It's not mandatory to include types in docstring,
117117
however, simple types like `int`, `str`, `float`, `bool` can be included.
118-
* Using `optional` is a good way to indicate that a parameter is optional.
119118
* Properties and attribute docs don't need a type when this is already clear from
120119
type or return annotation.
121120

arcade/application.py

+32-32
Original file line numberDiff line numberDiff line change
@@ -86,51 +86,51 @@ class Window(pyglet.window.Window):
8686
.. _pyglet_pg_window_style: https://pyglet.readthedocs.io/en/latest/programming_guide/windowing.html#window-style
8787
8888
Args:
89-
width (optional):
89+
width:
9090
Window width. Defaults to 1280.
91-
height (optional):
91+
height:
9292
Window height. Defaults to 720.
93-
title (optional):
93+
title:
9494
The title/caption of the window
95-
fullscreen (optional):
95+
fullscreen:
9696
Should this be full screen?
97-
resizable (optional):
97+
resizable:
9898
Can the user resize the window?
99-
update_rate (optional):
99+
update_rate:
100100
How frequently to run the on_update event.
101-
draw_rate (optional):
101+
draw_rate:
102102
How frequently to run the on_draw event. (this is the FPS limit)
103-
fixed_rate (optional):
103+
fixed_rate:
104104
How frequently should the fixed_updates run,
105105
fixed updates will always run at this rate.
106-
fixed_frame_cap (optional):
106+
fixed_frame_cap:
107107
The maximum number of fixed updates that can occur in one update loop.
108108
defaults to infinite. If large lag spikes cause your game to freeze,
109109
try setting this to a smaller number. This may cause your physics to
110110
lag behind temporarily.
111-
antialiasing (optional):
111+
antialiasing:
112112
Use multisampling framebuffer (antialiasing)
113113
samples: Number of samples used in antialiasing (default 4).
114114
Usually this is 2, 4, 8 or 16.
115-
gl_version (optional): What OpenGL version to request.
115+
gl_version: What OpenGL version to request.
116116
This is ``(3, 3)`` by default and can be overridden when using more
117117
advanced OpenGL features.
118-
screen (optional): Pass a pyglet :py:class:`~pyglet.display.Screen` to
118+
screen: Pass a pyglet :py:class:`~pyglet.display.Screen` to
119119
request the window be placed on it. See `pyglet's window size &
120120
position guide <pyglet_pg_window_size_position_>`_ to learn more.
121-
style (optional): Request a non-default window style, such as borderless.
121+
style: Request a non-default window style, such as borderless.
122122
Some styles only work in certain situations. See `pyglet's guide
123123
to window style <pyglet_pg_window_style_>`_ to learn more.
124-
visible (optional):
124+
visible:
125125
Should the window be visible immediately
126-
vsync (optional):
126+
vsync:
127127
Wait for vertical screen refresh before swapping buffer
128128
This can make animations and movement look smoother.
129-
gc_mode (optional): Decides how OpenGL objects should be garbage collected
129+
gc_mode: Decides how OpenGL objects should be garbage collected
130130
("context_gc" (default) or "auto")
131-
center_window (optional):
131+
center_window:
132132
If true, will center the window.
133-
enable_polling (optional):
133+
enable_polling:
134134
Enabled input polling capability.
135135
This makes the :py:attr:`keyboard` and :py:attr:`mouse` attributes available for use.
136136
@@ -356,17 +356,17 @@ def clear( # type: ignore # not sure what to do here, BaseWindow.clear is stati
356356
set through :py:attr:`~arcade.Window.background_color`.
357357
358358
Args:
359-
color (optional):
359+
color:
360360
Override the current background color with one of the following:
361361
362362
1. A :py:class:`~arcade.types.Color` instance
363363
2. A 3 or 4-length RGB/RGBA :py:class:`tuple` of byte values (0 to 255)
364364
365-
color_normalized (optional):
365+
color_normalized:
366366
override the current background color using normalized values (0.0 to 1.0).
367367
For example, (1.0, 0.0, 0.0, 1.0) making the window contents red.
368368
369-
viewport (optional):
369+
viewport:
370370
The area of the window to clear. By default, the entire window is cleared.
371371
The viewport format is ``(x, y, width, height)``.
372372
"""
@@ -455,19 +455,19 @@ def set_fullscreen(
455455
to the size it was before entering fullscreen mode.
456456
457457
Args:
458-
fullscreen (optional):
458+
fullscreen:
459459
Should we enter or leave fullscreen mode?
460-
screen (optional):
460+
screen:
461461
Which screen should we display on? See :func:`get_screens`
462-
mode (optional):
462+
mode:
463463
The screen will be switched to the given mode. The mode must
464464
have been obtained by enumerating `Screen.get_modes`. If
465465
None, an appropriate mode will be selected from the given
466466
`width` and `height`.
467-
width (optional):
468-
Override the width of the window. Will be rounded to :py:attr:`int`.
469-
height (optional):
470-
Override the height of the window. Will be rounded to :py:attr:`int`.
467+
width:
468+
Override the width of the window. Will be rounded to :py:class:`int`.
469+
height:
470+
Override the height of the window. Will be rounded to :py:class:`int`.
471471
"""
472472
# fmt: off
473473
super().set_fullscreen(
@@ -1280,7 +1280,7 @@ class View:
12801280
and a game over screen. Each of these could be a different view.
12811281
12821282
Args:
1283-
window (optional):
1283+
window:
12841284
The window this view is associated with. If None, the current
12851285
window is used. (Normally you don't need to provide this).
12861286
"""
@@ -1304,15 +1304,15 @@ def clear(
13041304
set through :py:attr:`arcade.View.background_color`.
13051305
13061306
Args:
1307-
color(optional):
1307+
color:
13081308
override the current background color with one of the following:
13091309
13101310
1. A :py:class:`~arcade.types.Color` instance
13111311
2. A 3 or 4-length RGB/RGBA :py:class:`tuple` of byte values (0 to 255)
1312-
color_normalized (optional):
1312+
color_normalized:
13131313
Override the current background color using normalized values (0.0 to 1.0).
13141314
For example, (1.0, 0.0, 0.0, 1.0) making the window contents red.
1315-
viewport (optional):
1315+
viewport:
13161316
The viewport range to clear
13171317
"""
13181318
if color is None and color_normalized is None:

arcade/camera/README.md

-90
This file was deleted.

arcade/camera/camera_2d.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ def from_camera_data(
197197
198198
Args:
199199
camera_data:
200-
A :py:class:`~arcade.camera.data.CameraData`
200+
A :py:class:`~arcade.camera.CameraData`
201201
describing the position, up, forward and zoom.
202202
projection_data:
203-
A :py:class:`~arcade.camera.data.OrthographicProjectionData`
203+
A :py:class:`~arcade.camera.OrthographicProjectionData`
204204
which describes the left, right, top, bottom, far, near
205205
planes and the viewport for an orthographic projection.
206206
render_target:
@@ -377,10 +377,10 @@ def match_target(
377377
Sets the viewport to the size of the Camera2D's render target.
378378
379379
Args:
380-
viewport: Flag whether to equalise the viewport to the area of the render target
381-
projection: Flag whether to equalise the size of the projection to
382-
match the render target
383-
The projection center stays fixed, and the new projection matches only in size.
380+
viewport: Flag whether to equalize the viewport to the area of the render target
381+
projection: Flag whether to equalize the size of the projection to
382+
match the render target.
383+
The projection center stays fixed, and the new projection matches only in size.
384384
scissor: Flag whether to update the scissor value.
385385
position: Flag whether to also center the camera to the value.
386386
Off by default
@@ -415,14 +415,14 @@ def update_values(
415415
aspect: float | None = None,
416416
):
417417
"""
418-
Convienence method for updating the viewport, projection, position
418+
Convenience method for updating the viewport, projection, position
419419
and a few others with the same value.
420420
421421
Args:
422422
value: The rect that the values will be derived from.
423-
viewport: Flag whether to equalise the viewport to the value.
424-
projection: Flag whether to equalise the size of the projection to match the value.
425-
The projection center stays fixed, and the new projection matches only in size.
423+
viewport: Flag whether to equalize the viewport to the value.
424+
projection: Flag whether to equalize the size of the projection to match the value.
425+
The projection center stays fixed, and the new projection matches only in size.
426426
scissor: Flag whether to update the scissor value.
427427
position: Flag whether to also center the camera to the value.
428428
Off by default
@@ -456,6 +456,7 @@ def update_values(
456456
def aabb(self) -> Rect:
457457
"""
458458
Retrieve the axis-aligned bounds box of the camera's view area.
459+
459460
If the camera isn't rotated , this will be precisely the view area,
460461
but it will cover a larger area when it is rotated. Useful for CPU culling
461462
"""

arcade/camera/data_types.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,14 @@ def use(self) -> None:
417417
:py:attr:`~arcade.Window.current_camera` to this object
418418
#. Calculate any required view and projection matrices
419419
#. Set any resulting values on the current
420-
:py:class:`~arcade.context.ArcadeContext`, including the:
420+
:py:class:`~arcade.ArcadeContext`, including the:
421421
422-
* :py:attr:`~arcade.context.ArcadeContext.viewport`
423-
* :py:attr:`~arcade.context.ArcadeContext.view_matrix`
424-
* :py:attr:`~arcade.context.ArcadeContext.projection_matrix`
422+
* :py:attr:`~arcade.ArcadeContext.viewport`
423+
* :py:attr:`~arcade.ArcadeContext.view_matrix`
424+
* :py:attr:`~arcade.ArcadeContext.projection_matrix`
425425
426426
This method should **never** handle cleanup. That is the
427427
responsibility of :py:attr:`.activate`.
428-
429428
"""
430429
...
431430

arcade/camera/perspective.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ def generate_projection_matrix(self) -> Mat4:
108108
"""Generates a projection matrix.
109109
110110
This is an alias of
111-
:py:class:`arcade.camera.get_perspective_matrix`.
111+
:py:meth:`generate_perspective_matrix`.
112112
"""
113113
return generate_perspective_matrix(self._projection, self._view.zoom)
114114

115115
def generate_view_matrix(self) -> Mat4:
116116
"""Generates a view matrix.
117117
118118
This is an alias of=
119-
:py:class:`arcade.camera.get_view_matrix`.
119+
:py:meth:`generate_view_matrix`.
120120
"""
121121
return generate_view_matrix(self._view)
122122

@@ -171,7 +171,7 @@ def project(self, world_coordinate: Point) -> Vec2:
171171
"""Convert world coordinates to pixel screen coordinates.
172172
173173
If a 2D :py:class:`~pyglet.math.Vec2` is provided instead of a 3D
174-
:py:class:`Vec3`, then one will be calculated to the best of the
174+
:py:class:`~pyglet.math.Vec3`, then one will be calculated to the best of the
175175
method's ability.
176176
177177
Args:

0 commit comments

Comments
 (0)