Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions arcade/camera/camera_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions arcade/draw/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/backends/opengl/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/backends/opengl/framebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down
3 changes: 2 additions & 1 deletion arcade/gl/backends/opengl/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/backends/opengl/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
7 changes: 4 additions & 3 deletions arcade/gl/backends/opengl/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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 <https://docs.python.org/3/c-api/buffer.html>`_.

The latter category includes ``bytes``, ``bytearray``,
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions arcade/gl/backends/opengl/texture_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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 <https://docs.python.org/3/c-api/buffer.html>`_.

The latter category includes ``bytes``, ``bytearray``,
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/backends/opengl/vertex_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions arcade/gl/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down Expand Up @@ -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.")

Expand Down
4 changes: 2 additions & 2 deletions arcade/gl/framebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion arcade/gl/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
7 changes: 4 additions & 3 deletions arcade/gl/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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 <https://docs.python.org/3/c-api/buffer.html>`_.

The latter category includes ``bytes``, ``bytearray``,
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions arcade/gl/texture_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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 <https://docs.python.org/3/c-api/buffer.html>`_.

The latter category includes ``bytes``, ``bytearray``,
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/vertex_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gui/experimental/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion arcade/gui/experimental/scroll_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
10 changes: 5 additions & 5 deletions arcade/gui/experimental/typed_text_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arcade/gui/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
7 changes: 4 additions & 3 deletions arcade/gui/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
"""

Expand Down
Loading
Loading