diff --git a/arcade/application.py b/arcade/application.py index a5ee05c86b..29865b2eda 100644 --- a/arcade/application.py +++ b/arcade/application.py @@ -1109,7 +1109,8 @@ def camera(self) -> DefaultProjector: pyglet looks up ``Window.camera`` (rather than ``default_camera``) as the fallback camera for batch draws with no camera explicitly - set, so this needs to resolve to the same :py:class:`DefaultProjector` + set, so this needs to resolve to the same + :py:class:`~arcade.camera.default.DefaultProjector` to keep pyglet's internal drawing (e.g. :py:class:`~pyglet.text.Label`) going through arcade's projection/scissor handling. diff --git a/arcade/camera/camera_2d.py b/arcade/camera/camera_2d.py index d35a6a3194..2bf94c5864 100644 --- a/arcade/camera/camera_2d.py +++ b/arcade/camera/camera_2d.py @@ -586,7 +586,7 @@ def move_to(self, position: Point2, *, duration: float | None = None) -> Point2: def move_by(self, change: Point2) -> Point2: """ Move the camera in world space along the XY axes by the provided change. - If you want to drag the camera with a mouse :py:func:`camera2D.drag_by` + If you want to drag the camera with a mouse :py:meth:`drag_by` is the method to use. Args: @@ -611,7 +611,7 @@ def drag_by(self, change: Point2) -> Point2: move right. So a user moving the mouse right expects the camera to move left. - The simplest use case is with the Window/View's :py:func:`on_mouse_drag` + The simplest use case is with the Window/View's :py:meth:`~arcade.Window.on_mouse_drag` .. code-block:: python def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers): diff --git a/arcade/draw/point.py b/arcade/draw/point.py index d5312e3f02..c4e1827b57 100644 --- a/arcade/draw/point.py +++ b/arcade/draw/point.py @@ -15,7 +15,7 @@ def draw_point(x: float, y: float, color: RGBOrA255, size: float = 1.0) -> None: To draw more rounded shapes, please see: - * :py:func:`arcade.draw.circle.draw_circle_filled` + * :py:func:`arcade.draw_circle_filled` * :py:func:`pyglet.shapes.Circle` Args: @@ -40,7 +40,7 @@ def draw_points(point_list: Point2List, color: RGBOrA255, size: float = 1.0) -> To draw more rounded shapes, please see: - * :py:func:`arcade.draw.circle.draw_circle_filled` + * :py:func:`arcade.draw_circle_filled` * :py:func:`pyglet.shapes.Circle` Args: diff --git a/arcade/gl/__init__.py b/arcade/gl/__init__.py index ad05c7c84a..760111611f 100644 --- a/arcade/gl/__init__.py +++ b/arcade/gl/__init__.py @@ -8,7 +8,7 @@ * Arcade users should access :py:attr:`arcade.Window.ctx` exposing an :py:class:`arcade.ArcadeContext` -* Pyglet users can instantiate an :py:class:`arcade.gl.Context` for the window or +* Pyglet users can instantiate an :py:class:`arcade.gl.context.Context` for the window or extend this class with more features if needed. .. warning:: This module contains the low level rendering API for arcade diff --git a/arcade/gl/backends/opengl/buffer.py b/arcade/gl/backends/opengl/buffer.py index 3e230689c1..8990eb4f99 100644 --- a/arcade/gl/backends/opengl/buffer.py +++ b/arcade/gl/backends/opengl/buffer.py @@ -30,7 +30,7 @@ class OpenGLBuffer(Buffer): types. See :ref:`prog-guide-gl-buffer-protocol-typing` for more information. - .. warning:: Buffer objects should be created using :py:meth:`arcade.gl.Context.buffer` + .. warning:: Buffer objects should be created using :py:meth:`arcade.gl.context.Context.buffer` Args: ctx: diff --git a/arcade/gl/backends/opengl/framebuffer.py b/arcade/gl/backends/opengl/framebuffer.py index d027a384c3..08480158b4 100644 --- a/arcade/gl/backends/opengl/framebuffer.py +++ b/arcade/gl/backends/opengl/framebuffer.py @@ -25,7 +25,7 @@ class OpenGLFramebuffer(Framebuffer): The advantage of using texture attachments is the ability we get to keep working on the contents of the framebuffer. - The best way to create framebuffer is through :py:meth:`arcade.gl.Context.framebuffer`:: + The best way to create framebuffer is through :py:meth:`arcade.gl.context.Context.framebuffer`:: # Create a 100 x 100 framebuffer with one attachment ctx.framebuffer(color_attachments=[ctx.texture((100, 100), components=4)]) diff --git a/arcade/gl/backends/opengl/program.py b/arcade/gl/backends/opengl/program.py index 3a786d27ce..c9398e53aa 100644 --- a/arcade/gl/backends/opengl/program.py +++ b/arcade/gl/backends/opengl/program.py @@ -43,7 +43,8 @@ class OpenGLProgram(Program): Transform feedback also supported when output attributes names are passed in the varyings parameter. - The best way to create a program instance is through :py:meth:`arcade.gl.Context.program` + The best way to create a program instance is through + :py:meth:`arcade.gl.context.Context.program` Args: ctx: diff --git a/arcade/gl/backends/opengl/query.py b/arcade/gl/backends/opengl/query.py index 2aa5236521..dc8ef4c668 100644 --- a/arcade/gl/backends/opengl/query.py +++ b/arcade/gl/backends/opengl/query.py @@ -16,7 +16,7 @@ class OpenGLQuery(Query): """ A query object to perform low level measurements of OpenGL rendering calls. - The best way to create a program instance is through :py:meth:`arcade.gl.Context.query` + The best way to create a program instance is through :py:meth:`arcade.gl.context.Context.query` Example usage:: diff --git a/arcade/gl/backends/opengl/texture.py b/arcade/gl/backends/opengl/texture.py index 4f8a8dc193..0b1f86cd2a 100644 --- a/arcade/gl/backends/opengl/texture.py +++ b/arcade/gl/backends/opengl/texture.py @@ -50,7 +50,8 @@ class OpenGLTexture2D(Texture2D): A texture can also be created with different datatypes such as float, integer or unsigned integer. - The best way to create a texture instance is through :py:meth:`arcade.gl.Context.texture` + The best way to create a texture instance is through + :py:meth:`arcade.gl.context.Context.texture` Supported ``dtype`` values are:: @@ -530,7 +531,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> """Write byte data from the passed source to the texture. The ``data`` value can be either an - :py:class:`arcade.gl.Buffer` or anything that implements the + :py:class:`arcade.gl.buffer.Buffer` or anything that implements the `Buffer Protocol `_. The latter category includes ``bytes``, ``bytearray``, @@ -541,7 +542,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> Args: data: - :class:`~arcade.gl.Buffer` or buffer protocol object with data to write. + :class:`~arcade.gl.buffer.Buffer` or buffer protocol object with data to write. level: The texture level to write viewport: diff --git a/arcade/gl/backends/opengl/texture_array.py b/arcade/gl/backends/opengl/texture_array.py index e3ba07efe4..359614394c 100644 --- a/arcade/gl/backends/opengl/texture_array.py +++ b/arcade/gl/backends/opengl/texture_array.py @@ -51,7 +51,8 @@ class OpenGLTextureArray(TextureArray): A texture can also be created with different datatypes such as float, integer or unsigned integer. - The best way to create a texture instance is through :py:meth:`arcade.gl.Context.texture` + The best way to create a texture instance is through + :py:meth:`arcade.gl.context.Context.texture` Supported ``dtype`` values are:: @@ -481,7 +482,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> """Write byte data into layers of the texture. The ``data`` value can be either an - :py:class:`arcade.gl.Buffer` or anything that implements the + :py:class:`arcade.gl.buffer.Buffer` or anything that implements the `Buffer Protocol `_. The latter category includes ``bytes``, ``bytearray``, @@ -492,7 +493,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> Args: data: - :class:`~arcade.gl.Buffer` or buffer protocol object with data to write. + :class:`~arcade.gl.buffer.Buffer` or buffer protocol object with data to write. level: The texture level to write (LoD level, now layer) viewport: diff --git a/arcade/gl/backends/opengl/vertex_array.py b/arcade/gl/backends/opengl/vertex_array.py index 062936ea96..78aee3d6cb 100644 --- a/arcade/gl/backends/opengl/vertex_array.py +++ b/arcade/gl/backends/opengl/vertex_array.py @@ -453,7 +453,7 @@ class OpenGLGeometry(Geometry): for very flexible rendering pipelines and saves the user from a lot of manual bookkeeping. - Geometry objects should be created through :py:meth:`arcade.gl.Context.geometry` + Geometry objects should be created through :py:meth:`arcade.gl.context.Context.geometry` Args: ctx: diff --git a/arcade/gl/buffer.py b/arcade/gl/buffer.py index 56e55ca4ac..47769b6dd0 100644 --- a/arcade/gl/buffer.py +++ b/arcade/gl/buffer.py @@ -26,7 +26,7 @@ class Buffer(ABC): types. See :ref:`prog-guide-gl-buffer-protocol-typing` for more information. - .. warning:: Buffer objects should be created using :py:meth:`arcade.gl.Context.buffer` + .. warning:: Buffer objects should be created using :py:meth:`arcade.gl.context.Context.buffer` Args: ctx: diff --git a/arcade/gl/context.py b/arcade/gl/context.py index 2466715cbf..35c775cb24 100644 --- a/arcade/gl/context.py +++ b/arcade/gl/context.py @@ -692,11 +692,11 @@ def point_size(self) -> float: Set or get the point size. Default is `1.0`. Point size changes the pixel size of rendered points. The min and max values - are limited by :py:attr:`~arcade.gl.context.Limits.POINT_SIZE_RANGE`. + are limited by ``ctx.info.POINT_SIZE_RANGE``. This value usually at least ``(1, 100)``, but this depends on the drivers/vendors. If variable point size is needed you can enable - :py:attr:`~arcade.gl.Context.PROGRAM_POINT_SIZE` and write to ``gl_PointSize`` + ``ctx.PROGRAM_POINT_SIZE`` and write to ``gl_PointSize`` in the vertex or geometry shader. .. Note:: @@ -967,7 +967,7 @@ def texture_array( Note that ``size`` is a 3-tuple where the last value is the number of layers. - See :py:meth:`~arcade.gl.Context.texture` for arguments. + See :py:meth:`~arcade.gl.context.Context.texture` for arguments. """ raise NotImplementedError("The enabled graphics backend does not support this method.") diff --git a/arcade/gl/framebuffer.py b/arcade/gl/framebuffer.py index ae295e21d4..5af0b5cab5 100644 --- a/arcade/gl/framebuffer.py +++ b/arcade/gl/framebuffer.py @@ -20,7 +20,7 @@ class Framebuffer(ABC): The advantage of using texture attachments is the ability we get to keep working on the contents of the framebuffer. - The best way to create framebuffer is through :py:meth:`arcade.gl.Context.framebuffer`:: + The best way to create framebuffer is through :py:meth:`arcade.gl.context.Context.framebuffer`:: # Create a 100 x 100 framebuffer with one attachment ctx.framebuffer(color_attachments=[ctx.texture((100, 100), components=4)]) @@ -176,7 +176,7 @@ def depth_attachment(self) -> Texture2D | None: @property def depth_mask(self) -> bool: """ - Get or set the depth mask (default: ``True``). + Get or set the depth mask. Defaults to ``True``. It determines if depth values should be written to the depth texture when depth testing is enabled. diff --git a/arcade/gl/program.py b/arcade/gl/program.py index 4eb56fe3bc..3d8b8be7ab 100644 --- a/arcade/gl/program.py +++ b/arcade/gl/program.py @@ -22,7 +22,8 @@ class Program(ABC): Transform feedback also supported when output attributes names are passed in the varyings parameter. - The best way to create a program instance is through :py:meth:`arcade.gl.Context.program` + The best way to create a program instance is through + :py:meth:`arcade.gl.context.Context.program` Args: ctx: diff --git a/arcade/gl/query.py b/arcade/gl/query.py index dacf2eed99..edd3a2238e 100644 --- a/arcade/gl/query.py +++ b/arcade/gl/query.py @@ -11,7 +11,7 @@ class Query(ABC): """ A query object to perform low level measurements of OpenGL rendering calls. - The best way to create a program instance is through :py:meth:`arcade.gl.Context.query` + The best way to create a program instance is through :py:meth:`arcade.gl.context.Context.query` Example usage:: diff --git a/arcade/gl/texture.py b/arcade/gl/texture.py index 60227e3fd2..dd4eeb5a48 100644 --- a/arcade/gl/texture.py +++ b/arcade/gl/texture.py @@ -21,7 +21,8 @@ class Texture2D(ABC): A texture can also be created with different datatypes such as float, integer or unsigned integer. - The best way to create a texture instance is through :py:meth:`arcade.gl.Context.texture` + The best way to create a texture instance is through + :py:meth:`arcade.gl.context.Context.texture` Supported ``dtype`` values are:: @@ -400,7 +401,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> """Write byte data from the passed source to the texture. The ``data`` value can be either an - :py:class:`arcade.gl.Buffer` or anything that implements the + :py:class:`arcade.gl.buffer.Buffer` or anything that implements the `Buffer Protocol `_. The latter category includes ``bytes``, ``bytearray``, @@ -411,7 +412,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> Args: data: - :class:`~arcade.gl.Buffer` or buffer protocol object with data to write. + :class:`~arcade.gl.buffer.Buffer` or buffer protocol object with data to write. level: The texture level to write viewport: diff --git a/arcade/gl/texture_array.py b/arcade/gl/texture_array.py index 345f732d22..e3aff1ea7c 100644 --- a/arcade/gl/texture_array.py +++ b/arcade/gl/texture_array.py @@ -18,7 +18,8 @@ class TextureArray(ABC): A texture can also be created with different datatypes such as float, integer or unsigned integer. - The best way to create a texture instance is through :py:meth:`arcade.gl.Context.texture` + The best way to create a texture instance is through + :py:meth:`arcade.gl.context.Context.texture` Supported ``dtype`` values are:: @@ -402,7 +403,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> """Write byte data into layers of the texture. The ``data`` value can be either an - :py:class:`arcade.gl.Buffer` or anything that implements the + :py:class:`arcade.gl.buffer.Buffer` or anything that implements the `Buffer Protocol `_. The latter category includes ``bytes``, ``bytearray``, @@ -413,7 +414,7 @@ def write(self, data: BufferOrBufferProtocol, level: int = 0, viewport=None) -> Args: data: - :class:`~arcade.gl.Buffer` or buffer protocol object with data to write. + :class:`~arcade.gl.buffer.Buffer` or buffer protocol object with data to write. level: The texture level to write (LoD level, now layer) viewport: diff --git a/arcade/gl/types.py b/arcade/gl/types.py index ec63583b39..c52d69de03 100644 --- a/arcade/gl/types.py +++ b/arcade/gl/types.py @@ -278,7 +278,7 @@ def __init__( normalized: Iterable[str] | None = None, instanced: bool = False, ): - #: The :py:class:`~arcade.gl.Buffer` this description object describes + #: The :py:class:`~arcade.gl.buffer.Buffer` this description object describes self.buffer = buffer # type: Buffer #: List of string attributes self.attributes = attributes diff --git a/arcade/gl/vertex_array.py b/arcade/gl/vertex_array.py index 9c7310c709..6106567340 100644 --- a/arcade/gl/vertex_array.py +++ b/arcade/gl/vertex_array.py @@ -211,7 +211,7 @@ class Geometry(ABC): for very flexible rendering pipelines and saves the user from a lot of manual bookkeeping. - Geometry objects should be created through :py:meth:`arcade.gl.Context.geometry` + Geometry objects should be created through :py:meth:`arcade.gl.context.Context.geometry` Args: ctx: diff --git a/arcade/gui/experimental/group.py b/arcade/gui/experimental/group.py index e8c1fb6c39..1ade9f6e1a 100644 --- a/arcade/gui/experimental/group.py +++ b/arcade/gui/experimental/group.py @@ -55,7 +55,7 @@ class UIRenderGroup(UILayout): # Intentionally shadows UIWidget.scale() scale: Property[float | tuple[float, float]] = Property(1.0) # type: ignore[assignment] """Scale factor applied around ``anchor``. - Shadows :meth:`UIWidget.scale`, which resizes the rect instead.""" + Shadows :meth:`~arcade.gui.UIWidget.scale`, which resizes the rect instead.""" tint = Property(WHITE) """Color multiplier applied to the whole subtree.""" offset_x = Property(0.0) diff --git a/arcade/gui/experimental/scroll_area.py b/arcade/gui/experimental/scroll_area.py index 0cab25d202..79c24389ab 100644 --- a/arcade/gui/experimental/scroll_area.py +++ b/arcade/gui/experimental/scroll_area.py @@ -187,7 +187,8 @@ class UIScrollArea(UILayout): (fill the width of the scroll area, grow to the natural content height) like ``UIBoxLayout``. - Scrolling is supported via mouse wheel, :class:`UIScrollBar` and, while + Scrolling is supported via mouse wheel, + :class:`~arcade.gui.experimental.scroll_area.UIScrollBar` and, while the mouse hovers the widget, the keyboard (arrow keys, PageUp/PageDown, Home/End). diff --git a/arcade/gui/experimental/typed_text_input.py b/arcade/gui/experimental/typed_text_input.py index 1e972ebe83..72eddb71c5 100644 --- a/arcade/gui/experimental/typed_text_input.py +++ b/arcade/gui/experimental/typed_text_input.py @@ -17,14 +17,14 @@ class UITypedTextInput(UIInputText, Generic[T]): """A text box which auto-converts to and from a :py:class:`type`. - The simplest usage is passing a :py:func:`type` which supports + The simplest usage is passing a :py:class:`type` which supports :py:func:`repr` and allows a single :py:class:`str` as an argument: .. code-block:: python self.float_input = UITypedTextInput(float, text="0.0") - In the example above, setting :py:attr:`self.float_input.text` to + In the example above, setting ``self.float_input.text`` to ``"string"`` will: #. Set both the text and the caret to the ``error_color`` passed at @@ -33,7 +33,7 @@ class UITypedTextInput(UIInputText, Generic[T]): To stop error propagation, pass You can customize your conversion to and from strings by overriding - the following arguments with custom :py:class:`callable` objects: + the following arguments with custom :py:func:`callable` objects: .. list-table:: :header-rows: 1 @@ -189,9 +189,9 @@ def value(self, new_value: T) -> None: def text(self) -> str: """Get/set the text of the widget. - In addition to basic behavior from :py:class:`UITextWidget`, + In addition to basic behavior from :py:class:`~arcade.gui.UITextWidget`, this also performs validation. To silence error propagation - from validation, set :py:attr:`emit_parse_exceptions` to + from validation, set ``emit_parse_exceptions`` to ``False``. """ return self.doc.text diff --git a/arcade/gui/mixins.py b/arcade/gui/mixins.py index e902407a02..4dbef3db35 100644 --- a/arcade/gui/mixins.py +++ b/arcade/gui/mixins.py @@ -60,7 +60,7 @@ class UIMouseFilterMixin(UIWidget): """:class:`UIMouseFilterMixin` can be used to catch all mouse events which occur inside this widget. - Useful for window like widgets, :class:`UIMouseEvents` should not trigger + Useful for window like widgets, mouse events should not trigger effects which are under the widget. """ diff --git a/arcade/gui/property.py b/arcade/gui/property.py index ec243343b2..542f753c5a 100644 --- a/arcade/gui/property.py +++ b/arcade/gui/property.py @@ -547,10 +547,11 @@ def set(self, instance, value: list): class AliasProperty(Property[P]): """A property that transparently delegates reads, writes, and listener - registration to a named :class:`Property` on a child object. + registration to a named :class:`~arcade.gui.Property` on a child object. This lets a parent widget expose a child's property as its own, so callers - can use :func:`bind` / :func:`unbind` on the parent without knowing about + can use :func:`~arcade.gui.bind` / :func:`~arcade.gui.unbind` on the parent without + knowing about the child: .. code-block:: python @@ -570,7 +571,7 @@ class UITextButton(UIWidget): returns the child object owning the real property. A plain attribute-name string (e.g. ``"_label"``) is also accepted as a convenience shorthand for ``lambda self: getattr(self, "_label")``. - child_prop_name: The attribute name of the :class:`Property` on the + child_prop_name: The attribute name of the :class:`~arcade.gui.Property` on the child class to delegate to. """ diff --git a/arcade/gui/ui_manager.py b/arcade/gui/ui_manager.py index ced9c4bfc6..a404ec0ab6 100644 --- a/arcade/gui/ui_manager.py +++ b/arcade/gui/ui_manager.py @@ -59,8 +59,8 @@ class UIManager(EventDispatcher): through the widget tree. If used within a view :py:meth:`UIManager.enable()` should be called from - :py:meth:`View.on_show_view()` and :py:meth:`UIManager.disable()` should be - called from :py:meth:`View.on_hide_view()` + :py:meth:`~arcade.View.on_show_view` and :py:meth:`UIManager.disable()` should be + called from :py:meth:`~arcade.View.on_hide_view` Supports `size_hint` to grow/shrink direct children dependent on window size. Supports `size_hint_min` to ensure size of direct children (e.g. UIBoxLayout). @@ -288,7 +288,7 @@ def _do_render(self, force=False): child._do_render(surface, force) def enable(self) -> None: - """Registers handler functions (`on_...`) to :py:attr:`arcade.gui.UIElement` + """Registers handler functions (``on_...``) to the window on_draw is not registered, to provide full control about draw order, so it has to be called by the devs themselves. diff --git a/arcade/gui/widgets/layout.py b/arcade/gui/widgets/layout.py index 63f6396279..0c7d50a0a5 100644 --- a/arcade/gui/widgets/layout.py +++ b/arcade/gui/widgets/layout.py @@ -200,7 +200,7 @@ def _place_child( class UIBoxLayout(UILayout): """Place widgets next to each other. Depending on the - :py:class:`~arcade.gui.UIBoxLayout.vertical` attribute, the widgets are + ``vertical`` attribute, the widgets are placed top to bottom or left to right. .. hint:: diff --git a/arcade/input/manager.py b/arcade/input/manager.py index 07009a7413..b57144280e 100644 --- a/arcade/input/manager.py +++ b/arcade/input/manager.py @@ -75,8 +75,7 @@ class InputManager: you intend to have multiple controllers connected to your game, each controller should have it's own InputManager. - For runnable examples of how to use this, please see Arcdade's - :ref:`built-in InputManager examples `. + For a runnable example, see ``arcade/examples/sprite_move_input_manager.py``. Args: controller: @@ -165,9 +164,10 @@ def serialize(self) -> RawInputManager: This does not include current values of inputs, but rather the structure of the InputManager. Including: - - Actions: All registered actions - - Axes: All registered axis inputs - - Current Mappings: All current mappings of underlying inputs to actions/axis + + - Actions: All registered actions + - Axes: All registered axis inputs + - Current Mappings: All current mappings of underlying inputs to actions/axis The output dictionary of this function can be passed to :meth:`arcade.InputManager.parse` to create a new InputManager from a serialized one. diff --git a/arcade/input/raw_dicts.py b/arcade/input/raw_dicts.py index f767f2e12a..6128f698eb 100644 --- a/arcade/input/raw_dicts.py +++ b/arcade/input/raw_dicts.py @@ -10,8 +10,8 @@ class RawBindBase(TypedDict): """General base for raw axis or action binds. Anything matching this can be passed to - :py:func:`~arcade.future.input.inputs.parse_mapping_input_enum` to - extract a corresponding :py:class:`~arcade.future.input.inputs.InputEnum` + :py:func:`~arcade.input.inputs.parse_mapping_input_enum` to + extract a corresponding :py:class:`~arcade.input.inputs.InputEnum` value. For specific raw types, see: @@ -35,14 +35,14 @@ class RawAxisMapping(RawBindBase): class RawAction(TypedDict): - """Annotates the raw form for :py:class:`ActionMapping`.""" + """Annotates the raw form for :py:class:`~arcade.input.ActionMapping`.""" name: str mappings: list[RawActionMapping] class RawAxis(TypedDict): - """Annotates the raw form for :py:class:`AxisMapping`.""" + """Annotates the raw form for :py:class:`~arcade.input.AxisMapping`.""" name: str mappings: list[RawAxisMapping] diff --git a/arcade/physics_engines.py b/arcade/physics_engines.py index 46f80d3302..a7c1202ba2 100644 --- a/arcade/physics_engines.py +++ b/arcade/physics_engines.py @@ -763,13 +763,13 @@ def platforms(self) -> list[SpriteSequence[Sprite]]: * - Movement Axis - :py:class:`~arcade.sprite.sprite.Sprite` Attributes to Set * - X (side to side) - - * :py:attr:`~arcade.sprite.sprite.Sprite.change_x` - * :py:attr:`~arcade.sprite.sprite.Sprite.boundary_left` - * :py:attr:`~arcade.sprite.sprite.Sprite.boundary_right` + - * :py:attr:`~arcade.Sprite.change_x` + * :py:attr:`~arcade.Sprite.boundary_left` + * :py:attr:`~arcade.Sprite.boundary_right` * - Y (up and down) - - * :py:attr:`~arcade.sprite.sprite.Sprite.change_y` - * :py:attr:`~arcade.sprite.sprite.Sprite.boundary_bottom` - * :py:attr:`~arcade.sprite.sprite.Sprite.boundary_top` + - * :py:attr:`~arcade.Sprite.change_y` + * :py:attr:`~arcade.Sprite.boundary_bottom` + * :py:attr:`~arcade.Sprite.boundary_top` For a working example, please see :ref:`sprite_moving_platforms`. """ @@ -940,7 +940,7 @@ def jump(self, velocity: float) -> None: def increment_jump_counter(self) -> None: """Update jump tracking if multi-jump is enabled. - If :py:attr:`allow_multi_jumps` is ``True``, calling this adds + If :py:attr:`allow_multi_jump` is ``True``, calling this adds ``1`` to :py:attr:`jumps_since_ground`. Otherwise, it does nothing. """ diff --git a/arcade/pymunk_physics_engine.py b/arcade/pymunk_physics_engine.py index 43e53dbc85..0647c906a9 100644 --- a/arcade/pymunk_physics_engine.py +++ b/arcade/pymunk_physics_engine.py @@ -57,7 +57,7 @@ class PymunkPhysicsEngine: objects. * Override this for objects by passing different value - :`add_sprite` or :py:meth:`add_spritelist` + :`add_sprite` or :py:meth:`add_sprite_list` * See :py:attr:`pymunk.Space.damping` to learn more maximum_incline_on_ground: @@ -120,8 +120,7 @@ class PymunkPhysicsEngine: objects by setting their positions and velocities directly: * :py:meth:`set_velocity` - * :py:meth:`set_velocity_horizontal` - * :py:meth:`set_velocity_vertical` + * :py:meth:`set_horizontal_velocity` * :py:meth:`set_position` diff --git a/arcade/scene.py b/arcade/scene.py index 101f54a779..c9c13a8b6a 100644 --- a/arcade/scene.py +++ b/arcade/scene.py @@ -61,7 +61,7 @@ class Scene: * :py:meth:`.add_sprite`, which adds sprites to layers by name * :py:meth:`.Scene.from_tilemap`, which creates a scene from a - :py:class:`~arcade.tilemap.TileMap` already loaded from tiled data + :py:class:`~arcade.tilemap.tilemap.TileMap` already loaded from tiled data * Fine-grained convenience methods for adding, deleting, and reordering sprite lists * Flexible but slow general convenience methods @@ -110,13 +110,13 @@ def __delitem__(self, sprite_list: int | str | SpriteList) -> None: @classmethod def from_tilemap(cls, tilemap: TileMap) -> "Scene": """ - Create a new Scene from a :py:class:`~arcade.tilemap.TileMap` object. + Create a new Scene from a :py:class:`~arcade.tilemap.tilemap.TileMap` object. The SpriteLists will use the layer names and ordering as defined in the Tiled file. Args: - tilemap: The :py:class:`~arcade.tilemap.TileMap` + tilemap: The :py:class:`~arcade.tilemap.tilemap.TileMap` object to create the scene from. """ scene = cls() diff --git a/arcade/sound.py b/arcade/sound.py index 3e30f31406..11a23e98d6 100644 --- a/arcade/sound.py +++ b/arcade/sound.py @@ -110,8 +110,8 @@ def play( Args: volume: Volume (``0.0`` is silent, ``1.0`` is loudest). - pan: Left / right channel balance (``-1`` is left, ``0.0`` is - center, and ``1.0`` is right). + pan: Left / right channel balance, from ``-1.0`` (left) through + ``0.0`` (center) to ``1.0`` (right). loop: ``True`` attempts to restart playback after finishing. speed: Change the speed (and pitch) of the sound. Default speed is ``1.0``. @@ -276,7 +276,7 @@ def play_sound( The ``sound`` must be a loaded :py:class:`Sound` object. If you pass a path or :py:class:`str`, the function will raise a - :py:class:`TypeError.` + :py:class:`TypeError`. .. important:: A :py:class:`Sound` with ``streaming=True`` loses features! @@ -311,8 +311,8 @@ def play_sound( Args: sound: A :py:class:`Sound` instance or ``None``. volume: From ``0.0`` (silent) to ``1.0`` (max volume). - pan: The left / right ear balance (``-1`` is left, ``0`` is center, - and ``1`` is right) + pan: The left / right ear balance, from ``-1`` (left) through + ``0`` (center) to ``1`` (right). loop: ``True`` makes playback restart each time it reaches the end. speed: How fast to play. Slower than ``1.0`` deepens sound while values higher than ``1.0`` raise the pitch. diff --git a/arcade/sprite/base.py b/arcade/sprite/base.py index a7f3af6b8f..96ef984159 100644 --- a/arcade/sprite/base.py +++ b/arcade/sprite/base.py @@ -280,7 +280,7 @@ def scale(self) -> Point2: See :py:attr:`.scale_x` and :py:attr:`.scale_y` for individual access. - See :py:meth:`.scale_multiply_uniform` for uniform scaling. + See :py:meth:`.multiply_scale` for uniform scaling. .. note:: Negative scale values are supported. @@ -729,7 +729,7 @@ def rescale_xy_relative_to_point(self, point: Point, factors_xy: Iterable[float] Internally, this function does the following: - 1. Multiply the x & y of the sprite's :py:attr:`~scale_xy` + 1. Multiply the x & y of the sprite's :py:attr:`scale` attribute by the corresponding part from ``factors_xy``. 2. Scale the x & y of the difference between the sprite's position and ``point`` by the corresponding component from diff --git a/arcade/sprite/sprite.py b/arcade/sprite/sprite.py index f2ed35e2b8..803e330502 100644 --- a/arcade/sprite/sprite.py +++ b/arcade/sprite/sprite.py @@ -107,28 +107,28 @@ def __init__( """ :py:class:`~arcade.physics_engines.PhysicsEnginePlatformer` uses this as the left boundary for moving - :py:attr:`~arcade.physics_engines.PhysicsEnginePlatformer.platforms`. + :py:attr:`~arcade.PhysicsEnginePlatformer.platforms`. """ self.boundary_right: float | None = None """ :py:class:`~arcade.physics_engines.PhysicsEnginePlatformer` uses this as the right boundary for moving - :py:attr:`~arcade.physics_engines.PhysicsEnginePlatformer.platforms`. + :py:attr:`~arcade.PhysicsEnginePlatformer.platforms`. """ self.boundary_top: float | None = None """ :py:class:`~arcade.physics_engines.PhysicsEnginePlatformer` uses this as the top boundary for moving - :py:attr:`~arcade.physics_engines.PhysicsEnginePlatformer.platforms`. + :py:attr:`~arcade.PhysicsEnginePlatformer.platforms`. """ self.boundary_bottom: float | None = None """ :py:class:`~arcade.physics_engines.PhysicsEnginePlatformer` uses this as the top boundary for moving - :py:attr:`~arcade.physics_engines.PhysicsEnginePlatformer.platforms`. + :py:attr:`~arcade.PhysicsEnginePlatformer.platforms`. """ self.cur_texture_index: int = 0 diff --git a/arcade/sprite_list/spatial_hash.py b/arcade/sprite_list/spatial_hash.py index f265f798a0..af8369043f 100644 --- a/arcade/sprite_list/spatial_hash.py +++ b/arcade/sprite_list/spatial_hash.py @@ -23,7 +23,7 @@ class ReadOnlySpatialHash(Protocol[SpriteType_co]): #. It is then manipulated outside the original context with a broader type Advanced users who want more information on the specifics should see the - comments of :py:class:`~arcade.sprite_list.SpriteList`. + comments of :py:class:`~arcade.SpriteList`. """ @abstractmethod @@ -51,7 +51,7 @@ def get_sprites_near_rect(self, rect: Rect) -> Set[SpriteType_co]: """ Return sprites in the same buckets as the given rectangle. - .. tip:: Use :py:mod:`arcade.types.rect`'s helper functions to create + .. tip:: Use the helper functions in ``arcade.types.rect`` to create rectangle objects! Args: diff --git a/arcade/sprite_list/sprite_list.py b/arcade/sprite_list/sprite_list.py index e75527b197..9a94447962 100644 --- a/arcade/sprite_list/sprite_list.py +++ b/arcade/sprite_list/sprite_list.py @@ -1583,7 +1583,8 @@ def buffer_positions_angle(self) -> Buffer: x, y and z positions. These are the center positions for each sprite. - This buffer is attached to the :py:attr:`~arcade.SpriteList.geometry` + This buffer is attached to the + :py:attr:`~arcade.sprite_list.sprite_list.SpriteListData.geometry` instance with name ``in_pos``. """ return self._storage_pos_angle @@ -1595,7 +1596,8 @@ def buffer_sizes(self) -> Buffer: The buffer contains 32 bit float width and height values. - This buffer is attached to the :py:attr:`~arcade.SpriteList.geometry` + This buffer is attached to the + :py:attr:`~arcade.sprite_list.sprite_list.SpriteListData.geometry` instance with name ``in_size``. """ return self._storage_size @@ -1608,7 +1610,8 @@ def buffer_colors(self) -> Buffer: This buffer contains a series of 32 bit floats representing the RGBA color for each sprite. 4 x floats = RGBA. - This buffer is attached to the :py:attr:`~arcade.SpriteList.geometry` + This buffer is attached to the + :py:attr:`~arcade.sprite_list.sprite_list.SpriteListData.geometry` instance with name ``in_color``. """ return self._storage_color @@ -1626,7 +1629,8 @@ def buffer_textures(self) -> Buffer: and rebuild a texture atlas without having to rebuild every single spritelist. - This buffer is attached to the :py:attr:`~arcade.SpriteList.geometry` + This buffer is attached to the + :py:attr:`~arcade.sprite_list.sprite_list.SpriteListData.geometry` instance with name ``in_texture``. Note that it should ideally an unsigned integer, but due to @@ -1649,7 +1653,8 @@ def buffer_indices(self) -> Buffer: the number of sprites. Rely on ``len(spritelist)`` for the correct length. - This index buffer is attached to the :py:attr:`~arcade.SpriteList.geometry` + This index buffer is attached to the + :py:attr:`~arcade.sprite_list.sprite_list.SpriteListData.geometry` instance and will be automatically be applied the the input buffers when rendering or transforming. """ diff --git a/arcade/text.py b/arcade/text.py index 1cdd26a345..47a595f449 100644 --- a/arcade/text.py +++ b/arcade/text.py @@ -843,7 +843,7 @@ def draw(self) -> None: .. warning:: Cameras affect text drawing! If you want to draw a custom GUI that doesn't move with the - game world, you will need a second :py:class:`~arcade.Camera` + game world, you will need a second :py:class:`~arcade.Camera2D` instance. For information on how to do this, see :ref:`sprite_move_scrolling`. """ @@ -1113,7 +1113,7 @@ def create_text_sprite( Valid options: ``"left"``, ``"center"``, ``"right"``. font_name: A font name, path to a font file, or list of names bold: Whether to draw the text as bold, and if a string, - how bold. See :py:attr:`arcade.gui.widgets.text.bold` to learn more. + how bold. See :py:attr:`arcade.Text.bold` to learn more. italic: Whether to draw the text as italic anchor_x: How to calculate the anchor point's x coordinate. Options: "left", "center", or "right" @@ -1295,7 +1295,7 @@ def draw_text( Valid options: ``"left"``, ``"center"``, ``"right"``. font_name: A font name, path to a font file, or list of names bold: Whether to draw the text as bold, and if a string, - how bold. See :py:attr:`arcade.gui.widgets.text.bold` to learn more. + how bold. See :py:attr:`arcade.Text.bold` to learn more. italic: Whether to draw the text as italic anchor_x: How to calculate the anchor point's x coordinate. Options: "left", "center", or "right" diff --git a/arcade/texture/spritesheet.py b/arcade/texture/spritesheet.py index cd432e29f9..2c8c56d5fd 100644 --- a/arcade/texture/spritesheet.py +++ b/arcade/texture/spritesheet.py @@ -28,7 +28,7 @@ class SpriteSheet: (0, 0) in the upper left corner. This matches the coordinate system used by PIL. Args: - path Path to the image to load. + path: Path to the image to load. image: PIL image to use. """ diff --git a/arcade/texture_atlas/atlas_default.py b/arcade/texture_atlas/atlas_default.py index 73cfb09eab..017eac39a6 100644 --- a/arcade/texture_atlas/atlas_default.py +++ b/arcade/texture_atlas/atlas_default.py @@ -226,7 +226,7 @@ def texture_uv_texture(self) -> Texture2D: def textures(self) -> list[Texture]: """ All textures instance added to the atlas regardless - of their internal state. See :py:meth:`unique_textures`` + of their internal state. See :py:attr:`unique_textures` for textures with unique image data and transformation. """ return list(self._textures) diff --git a/arcade/types/box.py b/arcade/types/box.py index f22d0da0ea..9d60f9fd9f 100644 --- a/arcade/types/box.py +++ b/arcade/types/box.py @@ -17,9 +17,8 @@ class BoxKwargs(TypedDict): """Annotates a plain :py:class:`dict` of :py:class:`Box` arguments. This is only meaningful as a type annotation during type checking. - For example, the :py:meth:`Box.kwargs ` - property returns an ordinary will actually be a :py:class:`dict` - of :py:class:`Box` field names to :py:class:`float` values. + It describes an ordinary :py:class:`dict` of :py:class:`Box` field + names to :py:class:`float` values. To learn more, please see: @@ -57,7 +56,6 @@ class Box(NamedTuple): * :py:func:`.XYZWHD` * :py:func:`.LRBTNF` * :py:func:`.LBNWHD` - * :py:meth:`.from_kwargs` """ @@ -332,7 +330,7 @@ def overlaps(self, other: Box) -> bool: ) def __and__(self, other: Box) -> Box | None: - """Shorthand for :py:meth:`Box.intersection(other) `. + """Shorthand for :py:meth:`Box.intersection(other) `. Args: other: Another :py:class:`Box` instance. diff --git a/arcade/types/color.py b/arcade/types/color.py index 685e7cc9e4..cce9a512a5 100644 --- a/arcade/types/color.py +++ b/arcade/types/color.py @@ -102,7 +102,7 @@ class Color(RGBA255): Regardless of the source format, all color channels must be between 0 and 255, inclusive. If any channel is outside this range, creation - will fail with a :py:class:`~arcade.utils.ByteRangeError`, which is a + will fail with a :py:class:`~arcade.exceptions.ByteRangeError`, which is a type of :py:class:`ValueError`. .. _colour: https://pypi.org/project/colour/ @@ -368,7 +368,7 @@ def from_normalized(cls, color_normalized: RGBANormalized) -> Self: If any input channels aren't normalized (between ``0.0`` and ``1.0``), this method will raise a - :py:class:`~arcade.utils.NormalizedRangeError` you can handle as + :py:class:`~arcade.exceptions.NormalizedRangeError` you can handle as a :py:class:`ValueError`. Examples:: diff --git a/arcade/types/rect.py b/arcade/types/rect.py index 3e2db6d25a..37b41e0f1b 100644 --- a/arcade/types/rect.py +++ b/arcade/types/rect.py @@ -15,12 +15,12 @@ class RectKwargs(TypedDict): - """Annotates a plain :py:class:`dict` of :py:class:`Rect` arguments. + """Annotates a plain :py:class:`dict` of :py:class:`~arcade.Rect` arguments. This is only meaningful as a type annotation during type checking. - For example, the :py:meth:`Rect.kwargs ` - property returns an ordinary will actually be a :py:class:`dict` - of :py:class:`Rect` field names to :py:class:`float` values. + For example, the :py:meth:`Rect.kwargs ` + property returns an ordinary :py:class:`dict` + of :py:class:`~arcade.Rect` field names to :py:class:`float` values. To learn more, please see: @@ -426,7 +426,7 @@ def intersection(self, other: Rect) -> Rect | None: return LRBT(left, right, bottom, top) def __and__(self, other: Rect) -> Rect | None: - """Shorthand for :py:meth:`rect.intersection(other) `. + """Shorthand for :py:meth:`rect.intersection(other) `. Args: other: Another :py:class:`Rect` instance. diff --git a/arcade/types/vector_like.py b/arcade/types/vector_like.py index 1965786585..3795769175 100644 --- a/arcade/types/vector_like.py +++ b/arcade/types/vector_like.py @@ -50,10 +50,10 @@ class AnchorPoint: Each is a :py:class:`~pyglet.math.Vec2` with axis values between ``0.0`` and ``1.0``. They can be used as arguments to - :py:meth:`Rect.uv_to_position ` + :py:meth:`Rect.uv_to_position ` to help calculate: - * a pixel offset inside a :py:class:`~arcade.types.Rect` + * a pixel offset inside a :py:class:`~arcade.Rect` * an absolute screen positions in pixels Advanced users may also find them useful when working with diff --git a/arcade/utils.py b/arcade/utils.py index e95c6996c3..8320209077 100644 --- a/arcade/utils.py +++ b/arcade/utils.py @@ -172,7 +172,7 @@ def grow_sequence( * ``True`` if we should :py:meth:`append ` * ``False`` if we should :py:meth:`extend ` - This includes both the :py:class:`callable` function and your own custom + This includes both the :py:func:`callable` function and your own custom functions. For example: .. code-block:: python @@ -193,7 +193,7 @@ def _validate_and_choose(item) -> bool: Args: destination: - A :py:func:`list` or other :py:class:`~typing.MutableSequence` + A :py:class:`list` or other :py:class:`~typing.MutableSequence` to append to or extend. source: A value source we'll use to grow the ``destination`` diff --git a/doc/api_docs/arcade.rst b/doc/api_docs/arcade.rst index c259a54b1e..f838770e16 100644 --- a/doc/api_docs/arcade.rst +++ b/doc/api_docs/arcade.rst @@ -34,10 +34,12 @@ for the Python Arcade library. See also: api/geometry api/game_controller api/joysticks + api/input api/window api/sound api/advanced_cameras api/path_finding + api/hexagon api/isometric api/earclip api/anim diff --git a/doc/api_docs/gl/compute_shader.rst b/doc/api_docs/gl/compute_shader.rst new file mode 100644 index 0000000000..5149b8005f --- /dev/null +++ b/doc/api_docs/gl/compute_shader.rst @@ -0,0 +1,11 @@ + +.. py:currentmodule:: arcade + +Compute Shader (Base) +===================== + +.. autoclass:: arcade.gl.compute_shader.ComputeShader + :members: + :undoc-members: + :show-inheritance: + :member-order: bysource diff --git a/doc/api_docs/gl/index.rst b/doc/api_docs/gl/index.rst index e1e353e250..266841acbb 100644 --- a/doc/api_docs/gl/index.rst +++ b/doc/api_docs/gl/index.rst @@ -33,36 +33,36 @@ The low-level API primitives and their reference implementation include: :header-rows: 1 * - Primitive - - Base (:py:mod:`arcade.gl`) - - OpenGL Reference Subclass (:py:mod:`arcade.gl.backends.opengl`) + - Base (``arcade.gl``) + - OpenGL Reference Subclass (``arcade.gl.backends.opengl``) * - GPU programs (shaders) - :py:class:`program.Program ` - - :py:class:`~arcade.gl.backends.opengl.program.Program` + - ``Program`` * - low-level texture objects [#textureTypes]_ - - :py:class:`arcade.gl.texture.Texture` - - :py:class:`~arcade.gl.backends.opengl.texture.Texture` + - :py:class:`arcade.gl.Texture2D` + - ``Texture`` * - framebuffers - :py:class:`arcade.gl.framebuffer.Framebuffer` - - :py:class:`~arcade.gl.backends.opengl.framebuffer.Framebuffer` + - ``Framebuffer`` * - queries - :py:class:`arcade.gl.query.Query` - - :py:class:`~arcade.gl.backends.opengl.query.Query` + - ``Query`` * - buffers - :py:class:`arcade.gl.buffer.Buffer` - - :py:class:`~arcade.gl.backends.opengl.buffer.Buffer` + - ``Buffer`` * - vertex arrays/geometry - :py:class:`arcade.gl.vertex_array.VertexArray` - - :py:class:`~arcade.gl.backends.opengl.vertex_array.VertexArray` + - ``VertexArray`` * - Compute shaders [#macOS]_ - - :py:class:`arcade.gl.compute_shader.ComputerShader` - - :py:class:`~arcade.gl.backends.opengl.compute_shader.ComputerShader` + - ``arcade.gl.compute_shader.ComputeShader`` + - ``ComputeShader`` Usage Reference ^^^^^^^^^^^^^^^ @@ -70,7 +70,7 @@ Usage Reference .. list-table:: * - Reference Backend - - :py:mod:`arcade.gl.backends.opengl` + - ``arcade.gl.backends.opengl`` * - Abstraction examples - See the `experimental examples`_ folder in the GitHub repo @@ -78,7 +78,7 @@ Usage Reference .. _experimental examples: https://github.com/pythonarcade/arcade/tree/development/arcade/experimental .. [#macOS] Compute shaders are not available on all platforms (see :ref:`arcade-api-gl-mac_no_compute_shaders`) -.. [#textureTypes] Most users want :py:class:`arcade.texture.Texture` (see :ref:`arcade-api-gl-two_texture_types`) +.. [#textureTypes] Most users want :py:class:`arcade.Texture` (see :ref:`arcade-api-gl-two_texture_types`) Graphics API Gotchas @@ -119,11 +119,11 @@ class. If you are still unsure, consult the table below: - Target Audience - Contents - * - :py:mod:`arcade.texture` + * - ``arcade.texture`` - Everyday users - Friendly texture object suitable for implementing gameplay - * - :py:mod:`arcade.gl.backends` ``texture`` submodules + * - ``arcade.gl.backends`` ``texture`` submodules - Platform-specific internals - Low-level abstractions which handle platform-specific behavior for: @@ -141,7 +141,7 @@ Current Backends OpenGL Backend """""""""""""" -The current implemented backend is the OpenGL/GLES wrapper in :py:mod:`arcade.gl.backends.opengl`. +The current implemented backend is the OpenGL/GLES wrapper in ``arcade.gl.backends.opengl``. To maximize hardware support, it requires at least one of the following: @@ -172,19 +172,19 @@ environments compared to the archived `arcade-web`_ protoype. Adding Backends """"""""""""""" -A new backend requires adding a submodule in :py:mod:`arcade.gl.backends` +A new backend requires adding a submodule in ``arcade.gl.backends`` which handles any initialization tasks to implement the following: * concreted versions of the classes in :ref:`arcade-api-gl-usage` -* exposes a concrete implementation of :py:class:`~arcade.gl.provider.BaseProvider` +* exposes a concrete implementation of ``arcade.gl.provider.BaseProvider`` Note that all resources are created through the -:py:class:`arcade.gl.Context` / :py:class:`arcade.ArcadeContext`. +:py:class:`arcade.gl.context.Context` / :py:class:`arcade.ArcadeContext`. An instance of this type should be accessible the window (:py:attr:`arcade.Window.ctx`). This API can also be used with pyglet by creating an instance -of :py:class:`arcade.gl.Context` after the window creation. +of :py:class:`arcade.gl.context.Context` after the window creation. The :py:class:`arcade.ArcadeContext` on the other hand extends the default Context with Arcade-specific helper methods and should only be used by arcade. @@ -200,6 +200,7 @@ and should only be used by arcade. framebuffer query program + compute_shader sampler exceptions types diff --git a/doc/programming_guide/event_loop.rst b/doc/programming_guide/event_loop.rst index 820ca26d08..471371754b 100644 --- a/doc/programming_guide/event_loop.rst +++ b/doc/programming_guide/event_loop.rst @@ -7,10 +7,10 @@ Introduction Python Arcade provides three simple methods to integrate with the event loop. All three methods are exposed to be overridden in :py:class:`arcade.Window` and :py:class:`arcade.View`. For advanced use cases it is possible to add own -handler via :py:func:`arcade.Window.push_handlers`. +handler via :py:meth:`~pyglet.event.EventDispatcher.push_handlers`. -:py:func:`on_draw` -^^^^^^^^^^^^^^^^^^ +:py:meth:`~arcade.Window.on_draw` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Provides a hook to render to the window. After the ``on_draw`` event, the window will draw to the screen. By default, this attempts to occur every 1/60 seconds @@ -26,8 +26,8 @@ possible and will raise an error. After every draw event camera state will be reset. This means that non-default cameras must be reused on every draw event. -:py:func:`on_update` -^^^^^^^^^^^^^^^^^^^^ +:py:meth:`~arcade.Window.on_update` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ provides a hook to update state which needs to happen at a roughly regular interval. The update event is not strictly paired to the draw event, but they share the same @@ -36,8 +36,8 @@ The event also provides a ``delta_time`` argument which is the time elapsed sinc last ``on_update`` event. You can change the rate at which ``on_update`` is called with the ``update_rate`` argument when initializing your :py:class:`arcade.Window`. -:py:func:`on_fixed_update` -^^^^^^^^^^^^^^^^^^^^^^^^^^ +:py:meth:`~arcade.Window.on_fixed_update` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ provides a hook to update state which must happen with an exactly regular interval. Because Arcade can't ensure the event is actually fired regularly it stores how diff --git a/doc/programming_guide/gui/animations.rst b/doc/programming_guide/gui/animations.rst index 404952a733..06071dd7bd 100644 --- a/doc/programming_guide/gui/animations.rst +++ b/doc/programming_guide/gui/animations.rst @@ -5,7 +5,7 @@ Animations .. admonition:: Experimental API - The GUI animation stack lives in :py:mod:`arcade.gui.experimental` and + The GUI animation stack lives in ``arcade.gui.experimental`` and may change within minor version updates without a deprecation period. Import the names from there, e.g. ``from arcade.gui.experimental import UIAnimatedGroup, rel``. @@ -267,7 +267,7 @@ Under the hood, animations implement the :py:class:`~arcade.gui.experimental.TransitionBase` protocol and are ticked via :py:meth:`~arcade.gui.experimental.UIAnimatedGroup.add_transition`. The low level building blocks in -:py:mod:`arcade.gui.experimental.transition` remain available for custom +``arcade.gui.experimental.transition`` remain available for custom behavior: - :py:class:`~arcade.gui.experimental.TransitionAttr` - tween a single attribute diff --git a/doc/programming_guide/headless.rst b/doc/programming_guide/headless.rst index 1a20d142ea..6eae637027 100644 --- a/doc/programming_guide/headless.rst +++ b/doc/programming_guide/headless.rst @@ -76,9 +76,9 @@ created through the :py:class:`~arcade.ArcadeContext` if needed. .. Warning:: If you are creating and destroying a lot of Arcade objects - you might want to look into :py:attr:`arcade.gl.Context.gc_mode`. + you might want to look into :py:attr:`arcade.gl.context.Context.gc_mode`. In Arcade we normally do garbage collection of OpenGL objects - once per frame by calling :py:meth:`~arcade.gl.Context.gc`. + once per frame by calling :py:meth:`~arcade.gl.context.Context.gc`. Examples -------- diff --git a/doc/programming_guide/opengl_notes.rst b/doc/programming_guide/opengl_notes.rst index 92217c59dc..db6c39aa89 100644 --- a/doc/programming_guide/opengl_notes.rst +++ b/doc/programming_guide/opengl_notes.rst @@ -103,7 +103,7 @@ any object that supports the `buffer protocol `_. The classes most useful to end users are: -* :py:meth:`arcade.gl.Buffer ` +* :py:meth:`arcade.gl.Buffer ` * :py:meth:`arcade.gl.Texture2D ` This functionality can be used for displaying the results of diff --git a/doc/programming_guide/texture_atlas.rst b/doc/programming_guide/texture_atlas.rst index 5e2da09e7d..7e6412fb50 100644 --- a/doc/programming_guide/texture_atlas.rst +++ b/doc/programming_guide/texture_atlas.rst @@ -55,7 +55,7 @@ Most users will not be aware that Arcade is using a texture atlas under the hood. More advanced users can take advantage of these if they run into limitations. -Arcade has a global default texture atlas stored in :py:attr:`arcade.Window.ctx.default_atlas`. +Arcade has a global default texture atlas stored in :py:attr:`window.ctx.default_atlas `. This is an instance of :py:class:`arcade.ArcadeContext` where the low level rendering API is accessed (OpenGL). diff --git a/doc/tutorials/hex_map/index.rst b/doc/tutorials/hex_map/index.rst index d28d2c1110..1a10ae212f 100644 --- a/doc/tutorials/hex_map/index.rst +++ b/doc/tutorials/hex_map/index.rst @@ -4,7 +4,7 @@ Working with Hexagonal Tilemaps =============================== This tutorial covers how to load and display hexagonal tilemaps in Arcade using -the `Tiled`_ map editor and Arcade's :mod:`arcade.hexagon` module. +the `Tiled`_ map editor and Arcade's ``arcade.hexagon`` module. You don't need to understand all the math behind hexagonal grids to follow this tutorial, but if you're building something with hexes, diff --git a/util/update_quick_index.py b/util/update_quick_index.py index d42eb18fb4..0f858f1503 100644 --- a/util/update_quick_index.py +++ b/util/update_quick_index.py @@ -180,6 +180,15 @@ def error(message: str) -> None: "use_declarations_in": ["arcade.controller"], }, "joysticks.rst": {"title": "Joystick", "use_declarations_in": ["arcade.joysticks"]}, + "input.rst": { + "title": "Input Manager", + "use_declarations_in": [ + "arcade.input.manager", + "arcade.input.input_mapping", + "arcade.input.inputs", + "arcade.input.raw_dicts", + ], + }, "window.rst": { "title": "Window and View", "use_declarations_in": [ @@ -191,6 +200,7 @@ def error(message: str) -> None: }, "sound.rst": {"title": "Sound", "use_declarations_in": ["arcade.sound"]}, "path_finding.rst": {"title": "Pathfinding", "use_declarations_in": ["arcade.paths"]}, + "hexagon.rst": {"title": "Hexagon Grids", "use_declarations_in": ["arcade.hexagon"]}, "isometric.rst": { "title": "Isometric Map (incomplete)", "use_declarations_in": ["arcade.isometric"], @@ -280,6 +290,7 @@ def error(message: str) -> None: "use_declarations_in": [ "arcade.future.light.lights", "arcade.future.video.video_player", + "arcade.future.texture_render_target", ], }, }