Skip to content

Commit

Permalink
Merge pull request #86 from PawelRoman/master
Browse files Browse the repository at this point in the history
Documetantion update
  • Loading branch information
maniek2332 committed Jun 7, 2020
2 parents e341237 + 1d59eb4 commit 1162aeb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/reference/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ Instance Methods:
Returns a distance from (x,y) to (other_vector.x, other_vector.y), in other words: distance between two points.
other_vector parameter must be :class:`geometry.Vector`

.. method:: Vector.angle_between(other_vector)

Returns angle between this vector and :code:`other_vector`, in radians. The other_vector parameter must
be :class:`geometry.Vector`

.. method:: Vector.angle_between_degrees(other_vector)

Returns angle between this vector and :code:`other_vector`, in degrees. The other_vector parameter must
be :class:`geometry.Vector`

.. method:: Vector.normalize()

Returns a new vector, normalized (i.e. unit vector)
Expand Down
22 changes: 20 additions & 2 deletions docs/reference/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ Mouse manager can be accessed via the :ref:`InputManager.mouse <InputManager.mou
The manager allows to check for the mouse buttons state (pressed/released). It also
allows to get the mouse pointer position.

Instance properties:

.. attribute:: MouseManager.relative_mode

Gets or sets relative mode (as bool). Default is :code:`False`. Enabling relative mode has two effects: it
hides the mouse pointer and it makes mouse motion events (:class:`MouseMotionEvent`) be published all the time
(by default those events are published only if mouse moves within game's window). Disabling the relative mode
shows the mouse pointer and makes mouse motion events be published only if mouse movement occurs within the
window.


Instance methods:

.. method:: MouseManager.is_pressed(mousebutton)
Expand Down Expand Up @@ -572,7 +583,10 @@ Instance properties:

.. class:: MouseMotionEvent

Represents a mouse motion event (changing mouse pointer position)
Represents a mouse motion event (changing mouse pointer position). By default those events are published when
mouse pointer is within the window. You can enable the :code:`relative_mode` on the :class:`MouseManager` - it hides the
mouse pointer and makes mouse motion events be published whenever the pointer is moved (inside or outside of the
window).

.. code-block:: python
Expand All @@ -587,13 +601,17 @@ Instance properties:

Returns mouse pointer position as :class:`geometry.Vector`.

.. attribute:: MouseButtonEvent.motion

Returns mouse pointer motion (difference between the current and previous position) as :class:`geometry.Vector`.


:class:`MouseWheelEvent` reference
-----------------------------------

.. class:: MouseWheelEvent

Represents a mouse wheel related event
Represents a mouse wheel related event.

Instance properties:

Expand Down

0 comments on commit 1162aeb

Please sign in to comment.