diff --git a/docs/README.md b/docs/README.md index bf49f76d51..71fdcee4b6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,6 +14,10 @@ Steps: - If you are using the legacy `python setup.py docs` (which is now deprecated): - (Run `python -m pip install -U pip setuptools` first if `ModuleNotFoundError: No module named setuptools` occurs) +You may want to test the new website style, you just have to edit +``docs/reST/conf.py`` and change the value of ``html_theme`` to ``sphinx_book_theme``. +(Make sure before to install the theme with ``python -m pip install sphinx_book_theme``) + This will create a new folder under the `docs` folder. In `docs/generated`, you will find a local copy of the pygame documentation. diff --git a/docs/reST/conf.py b/docs/reST/conf.py index cfd4138170..b31442d84b 100644 --- a/docs/reST/conf.py +++ b/docs/reST/conf.py @@ -104,6 +104,7 @@ # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = 'classic' +# html_theme = 'sphinx_book_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/docs/reST/index.rst b/docs/reST/index.rst index 53121de17a..9aa169b761 100644 --- a/docs/reST/index.rst +++ b/docs/reST/index.rst @@ -6,11 +6,8 @@ Pygame-ce Front Page :glob: :hidden: - ref/* - tutorials/en/* - tutorials/en/**/* - tutorials/ko/**/* - tutorials/es/* + modules + tutorials c_api filepaths logos diff --git a/docs/reST/modules.rst b/docs/reST/modules.rst new file mode 100644 index 0000000000..4a5b660231 --- /dev/null +++ b/docs/reST/modules.rst @@ -0,0 +1,98 @@ +Pygame modules +============== + +************************************************* + List of pygame modules +************************************************* + +.. toctree:: + :maxdepth: 2 + :glob: + :hidden: + + ref/pygame.rst + ref/* + +:doc:`ref/bufferproxy` + An array protocol view of surface pixels + +:doc:`ref/color` + Color representation. + +:doc:`ref/cursors` + Loading and compiling cursor images. + +:doc:`ref/display` + Configure the display surface. + +:doc:`ref/draw` + Drawing simple shapes like lines and ellipses to surfaces. + +:doc:`ref/event` + Manage the incoming events from various input devices and the windowing platform. + +:doc:`ref/examples` + Various programs demonstrating the use of individual pygame modules. + +:doc:`ref/font` + Loading and rendering TrueType fonts. + +:doc:`ref/freetype` + Enhanced pygame module for loading and rendering font faces. + +:doc:`ref/gfxdraw` + Anti-aliasing draw functions. + +:doc:`ref/image` + Loading, saving, and transferring of surfaces. + +:doc:`ref/joystick` + Manage the joystick devices. + +:doc:`ref/key` + Manage the keyboard device. + +:doc:`ref/locals` + Pygame constants. + +:doc:`ref/mixer` + Load and play sounds + +:doc:`ref/mouse` + Manage the mouse device and display. + +:doc:`ref/music` + Play streaming music tracks. + +:doc:`ref/pygame` + Top level functions to manage pygame. + +:doc:`ref/pixelarray` + Manipulate image pixel data. + +:doc:`ref/rect` + Flexible container for a rectangle. + +:doc:`ref/scrap` + Native clipboard access. + +:doc:`ref/sndarray` + Manipulate sound sample data. + +:doc:`ref/sprite` + Higher level objects to represent game images. + +:doc:`ref/surface` + Objects for images and the screen. + +:doc:`ref/surfarray` + Manipulate image pixel data. + +:doc:`ref/tests` + Test pygame. + +:doc:`ref/time` + Manage timing and framerate. + +:doc:`ref/transform` + Resize and move images. diff --git a/docs/reST/ref/color.rst b/docs/reST/ref/color.rst index b257aaea37..904087303c 100644 --- a/docs/reST/ref/color.rst +++ b/docs/reST/ref/color.rst @@ -3,6 +3,13 @@ :mod:`pygame.Color` =================== +.. toctree:: + :maxdepth: 2 + :glob: + :hidden: + + extra_infos/color_list.rst + .. currentmodule:: pygame .. class:: Color @@ -53,7 +60,7 @@ It can be passed as a ``color_value`` argument to :class:`Color` (useful with sets). - See :doc:`color_list` for samples of the available named colors. + See :doc:`extra_infos/color_list` for samples of the available named colors. :param int r: red value in the range of 0 to 255 inclusive :param int g: green value in the range of 0 to 255 inclusive @@ -67,7 +74,7 @@ | - **Color object:** clones the given :class:`Color` object | - **Color name: str:** name of the color to use, e.g. ``'red'`` (all the supported name strings can be found in the - :doc:`color_list`, with sample swatches) + :doc:`extra_infos/color_list`, with sample swatches) | - **HTML color format str:** ``'#rrggbbaa'`` or ``'#rrggbb'``, where rr, gg, bb, and aa are 2-digit hex numbers in the range of 0 to 0xFF inclusive, the aa (alpha) value defaults to 0xFF diff --git a/docs/reST/ref/draw.rst b/docs/reST/ref/draw.rst index a6e09d9319..6f22cfbcb1 100644 --- a/docs/reST/ref/draw.rst +++ b/docs/reST/ref/draw.rst @@ -52,7 +52,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param Rect rect: rectangle to draw, position and dimensions :param int width: (optional) used for line thickness or to indicate that the rectangle is to be filled (not to be confused with the width value @@ -110,7 +110,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param points: a sequence of 3 or more (x, y) coordinates that make up the vertices of the polygon, each *coordinate* in the sequence must be a tuple/list/:class:`pygame.math.Vector2` of 2 ints/floats, @@ -158,7 +158,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param center: center point of the circle as a sequence of 2 ints/floats, e.g. ``(x, y)`` :type center: tuple(int or float, int or float) or @@ -219,7 +219,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param center: center point of the circle as a sequence of 2 ints/floats, e.g. ``(x, y)`` :type center: tuple(int or float, int or float) or @@ -273,7 +273,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param Rect rect: rectangle to indicate the position and dimensions of the ellipse, the ellipse will be centered inside the rectangle and bounded by it @@ -314,7 +314,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param Rect rect: rectangle to indicate the position and dimensions of the ellipse which the arc will be based on, the ellipse will be centered inside the rectangle @@ -364,7 +364,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param start_pos: start position of the line, (x, y) :type start_pos: tuple(int or float, int or float) or list(int or float, int or float) or Vector2(int or float, int or float) @@ -416,7 +416,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param bool closed: if ``True`` an additional line segment is drawn between the first and last points in the ``points`` sequence :param points: a sequence of 2 or more (x, y) coordinates, where each @@ -536,7 +536,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param start_pos: start position of the line, (x, y) :type start_pos: tuple(int or float, int or float) or list(int or float, int or float) or Vector2(int or float, int or float) @@ -569,7 +569,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and :param Surface surface: surface to draw on :param color: color to draw with, the alpha value is optional if using a tuple ``(RGB[A])`` - :type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int]) + :type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int]) :param bool closed: if ``True`` an additional line segment is drawn between the first and last points in the ``points`` sequence :param points: a sequence of 2 or more (x, y) coordinates, where each diff --git a/docs/reST/ref/color_list.rst b/docs/reST/ref/extra_infos/color_list.rst similarity index 99% rename from docs/reST/ref/color_list.rst rename to docs/reST/ref/extra_infos/color_list.rst index 8b22682a80..43f0f4d957 100644 --- a/docs/reST/ref/color_list.rst +++ b/docs/reST/ref/extra_infos/color_list.rst @@ -1,4 +1,4 @@ -.. include:: common.txt +.. include:: ../../common.txt Named Colors ============ @@ -673,7 +673,7 @@ Named Colors .yellowgreen {background-color: #9acd32; color: #9acd32;} -:doc:`color` lets you specify any of these named colors when creating a new +:doc:`../color` lets you specify any of these named colors when creating a new ``pygame.Color`` (taken from the `colordict module `_). diff --git a/docs/reST/ref/extra_infos/common_joysticks.rst b/docs/reST/ref/extra_infos/common_joysticks.rst new file mode 100644 index 0000000000..91234fc865 --- /dev/null +++ b/docs/reST/ref/extra_infos/common_joysticks.rst @@ -0,0 +1,321 @@ +.. include:: ../../common.txt + +Common joysticks +================ + +This is a non exhaustive list of common joystick frequently used by pygame users. + +Nintendo Switch Left Joy-Con (pygame 2.x) +***************************************** + +The Nintendo Switch Left Joy-Con has 4 axes, 11 buttons, and 0 hats. The values for the 4 axes never change. +The controller is recognized as "Wireless Gamepad". +After SDL 2.24.0, The controller is recognized as "Nintendo Switch Joy-Con (L)". + + +* **Buttons**:: + + After SDL 2.24.0 Before SDL 2.24.0 + D-pad Up Button 2 Button 3 + D-pad Down Button 1 Button 0 + D-pad Left Button 3 Button 2 + D-pad Right Button 0 Button 1 + SL Button 9 Button 4 + SR Button 10 Button 5 + - Button 6 Button 8 + Stick In Button 7 Button 10 + Capture Button 5 Button 13 + L Button 17 Button 14 + ZL Button 19 Button 15 + +Reference : D-pad Up points toward SL and SR buttons. + +* **Hat/JoyStick**:: + + Down -> Up - Axis 1 Axis Y + Left -> Right - Axis 0 Axis X + + +Nintendo Switch Right Joy-Con (pygame 2.x) +****************************************** + +The Nintendo Switch Right Joy-Con has 4 axes, 11 buttons, and 0 hats. The values for the 4 axes never change. +The controller is recognized as "Wireless Gamepad". +After SDL 2.24.0, The controller is recognized as "Nintendo Switch Joy-Con (R)". + +* **Buttons**:: + + After SDL 2.24.0 Before SDL 2.24.0 + A Button Button 1 Button 0 + B Button Button 3 Button 2 + X Button Button 0 Button 1 + Y Button Button 2 Button 3 + SL Button 9 Button 4 + SR Button 10 Button 5 + + Button 6 Button 9 + Stick In Button 7 Button 11 + Home Button 5 Button 12 + R Button 16 Button 14 + ZR Button 18 Button 15 + +* **Hat/JoyStick**:: + + Down -> Up - Axis 1 Axis Y + Left -> Right - Axis 0 Axis X + +Nintendo Switch Left/Right Joy-Con (after SDL **2.24.0**) +********************************************************* +This device is created, if Nintendo Switch Joy-con Left and Nintendo Switch Joy-con Right are connected (these two devices are removed). +The Nintendo Switch Left/Right Joy-Con has 6 axes, 20 buttons, and 0 hats. The values for the 6 axes never change. +The controller is recognized as "Nintendo Switch Joy-Con (L/R)". + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 2 + Up -> Down - Axis 3 + +* **Buttons**:: + + A Button - Button 0 + B Button - Button 1 + X Button - Button 2 + Y Button - Button 3 + - Button - Button 4 + Home Button - Button 5 + + Button - Button 6 + ZL - Button ? Missing + ZR - Button ? Missing + L. Stick In - Button 9 + R. Stick In - Button 10 + D-pad Up - Button 11 + D-pad Down - Button 12 + D-pad Left - Button 13 + D-pad Right - Button 14 + Capture Button - Button 15 + Right SR - Button 16 + Left SL - Button 17 + Right SL - Button 18 + Left SR - Button 19 + +Nintendo Switch Pro Controller (pygame 2.x) +******************************************* + +The Nintendo Switch Pro Controller has 6 axes, 16 buttons, and 0 hats. +The controller is recognized as "Nintendo Switch Pro Controller". + + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 2 + Up -> Down - Axis 3 + +* **Left Trigger**:: + + Out -> In - Axis 4 + +* **Right Trigger**:: + + Out -> In - Axis 5 + +* **Buttons**:: + + A Button - Button 0 + B Button - Button 1 + X Button - Button 2 + Y Button - Button 3 + - Button - Button 4 + Home Button - Button 5 + + Button - Button 6 + L. Stick In - Button 7 + R. Stick In - Button 8 + Left Bumper - Button 9 + Right Bumper - Button 10 + D-pad Up - Button 11 + D-pad Down - Button 12 + D-pad Left - Button 13 + D-pad Right - Button 14 + Capture Button - Button 15 + + +XBox 360 Controller (pygame 2.x) +******************************** + +The Xbox 360 controller mapping has 6 axes, 11 buttons and 1 hat. +The controller is recognized as "Xbox 360 Controller". + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 3 + Up -> Down - Axis 4 + +* **Left Trigger**:: + + Out -> In - Axis 2 + +* **Right Trigger**:: + + Out -> In - Axis 5 + +* **Buttons**:: + + A Button - Button 0 + B Button - Button 1 + X Button - Button 2 + Y Button - Button 3 + Left Bumper - Button 4 + Right Bumper - Button 5 + Back Button - Button 6 + Start Button - Button 7 + L. Stick In - Button 8 + R. Stick In - Button 9 + Guide Button - Button 10 + +* **Hat/D-pad**:: + + Down -> Up - Y Axis + Left -> Right - X Axis + + +Playstation 4 Controller (pygame 2.x) +************************************* + +The PlayStation 4 controller mapping has 6 axes and 16 buttons. +The controller is recognized as "PS4 Controller". + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 2 + Up -> Down - Axis 3 + +* **Left Trigger**:: + + Out -> In - Axis 4 + +* **Right Trigger**:: + + Out -> In - Axis 5 + +* **Buttons**:: + + Cross Button - Button 0 + Circle Button - Button 1 + Square Button - Button 2 + Triangle Button - Button 3 + Share Button - Button 4 + PS Button - Button 5 + Options Button - Button 6 + L. Stick In - Button 7 + R. Stick In - Button 8 + Left Bumper - Button 9 + Right Bumper - Button 10 + D-pad Up - Button 11 + D-pad Down - Button 12 + D-pad Left - Button 13 + D-pad Right - Button 14 + Touch Pad Click - Button 15 + + +XBox 360 Controller (pygame 1.x) +******************************** + +The Xbox 360 controller mapping has 5 axes, 10 buttons, and 1 hat. +The controller is recognized as "Controller (XBOX 360 For Windows)". + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 4 + Up -> Down - Axis 3 + +* **Left Trigger & Right Trigger**:: + + RT -> LT - Axis 2 + +* **Buttons**:: + + A Button - Button 0 + B Button - Button 1 + X Button - Button 2 + Y Button - Button 3 + Left Bumper - Button 4 + Right Bumper - Button 5 + Back Button - Button 6 + Start Button - Button 7 + L. Stick In - Button 8 + R. Stick In - Button 9 + +* **Hat/D-pad**:: + + Down -> Up - Y Axis + Left -> Right - X Axis + + +Playstation 4 Controller (pygame 1.x) +************************************* + +The PlayStation 4 controller mapping has 6 axes, 14 buttons, and 1 hat. +The controller is recognized as "Wireless Controller". + +* **Left Stick**:: + + Left -> Right - Axis 0 + Up -> Down - Axis 1 + +* **Right Stick**:: + + Left -> Right - Axis 2 + Up -> Down - Axis 3 + +* **Left Trigger**:: + + Out -> In - Axis 5 + +* **Right Trigger**:: + + Out -> In - Axis 4 + +* **Buttons**:: + + Cross Button - Button 0 + Circle Button - Button 1 + Square Button - Button 2 + Triangle Button - Button 3 + Left Bumper - Button 4 + Right Bumper - Button 5 + L. Trigger(Full)- Button 6 + R. Trigger(Full)- Button 7 + Share Button - Button 8 + Options Button - Button 9 + L. Stick In - Button 10 + R. Stick In - Button 11 + PS Button - Button 12 + Touch Pad Click - Button 13 + +* **Hat/D-pad**:: + + Down -> Up - Y Axis + Left -> Right - X Axis \ No newline at end of file diff --git a/docs/reST/ref/joystick.rst b/docs/reST/ref/joystick.rst index bef725240d..028182a32d 100644 --- a/docs/reST/ref/joystick.rst +++ b/docs/reST/ref/joystick.rst @@ -8,6 +8,13 @@ | :sl:`Pygame module for interacting with joysticks, gamepads, and trackballs.` +.. toctree:: + :maxdepth: 2 + :glob: + :hidden: + + ./extra_infos/common_joysticks.rst + The joystick module manages the joystick devices on a computer. Joystick devices include trackballs and video-game-style gamepads, and the module allows the use of multiple buttons and "hats". @@ -380,317 +387,4 @@ between pygame 1 and pygame 2. Below are a couple of mappings for three popular Axis and hat mappings are listed from -1 to +1. -Nintendo Switch Left Joy-Con (pygame 2.x) -***************************************** - -The Nintendo Switch Left Joy-Con has 4 axes, 11 buttons, and 0 hats. The values for the 4 axes never change. -The controller is recognized as "Wireless Gamepad". -After SDL 2.24.0, The controller is recognized as "Nintendo Switch Joy-Con (L)". - - -* **Buttons**:: - - After SDL 2.24.0 Before SDL 2.24.0 - D-pad Up Button 2 Button 3 - D-pad Down Button 1 Button 0 - D-pad Left Button 3 Button 2 - D-pad Right Button 0 Button 1 - SL Button 9 Button 4 - SR Button 10 Button 5 - - Button 6 Button 8 - Stick In Button 7 Button 10 - Capture Button 5 Button 13 - L Button 17 Button 14 - ZL Button 19 Button 15 - -Reference : D-pad Up points toward SL and SR buttons. - -* **Hat/JoyStick**:: - - Down -> Up - Axis 1 Axis Y - Left -> Right - Axis 0 Axis X - - -Nintendo Switch Right Joy-Con (pygame 2.x) -****************************************** - -The Nintendo Switch Right Joy-Con has 4 axes, 11 buttons, and 0 hats. The values for the 4 axes never change. -The controller is recognized as "Wireless Gamepad". -After SDL 2.24.0, The controller is recognized as "Nintendo Switch Joy-Con (R)". - -* **Buttons**:: - - After SDL 2.24.0 Before SDL 2.24.0 - A Button Button 1 Button 0 - B Button Button 3 Button 2 - X Button Button 0 Button 1 - Y Button Button 2 Button 3 - SL Button 9 Button 4 - SR Button 10 Button 5 - + Button 6 Button 9 - Stick In Button 7 Button 11 - Home Button 5 Button 12 - R Button 16 Button 14 - ZR Button 18 Button 15 - -* **Hat/JoyStick**:: - - Down -> Up - Axis 1 Axis Y - Left -> Right - Axis 0 Axis X - -Nintendo Switch Left/Right Joy-Con (after SDL **2.24.0**) -********************************************************* -This device is created, if Nintendo Switch Joy-con Left and Nintendo Switch Joy-con Right are connected (these two devices are removed). -The Nintendo Switch Left/Right Joy-Con has 6 axes, 20 buttons, and 0 hats. The values for the 6 axes never change. -The controller is recognized as "Nintendo Switch Joy-Con (L/R)". - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 2 - Up -> Down - Axis 3 - -* **Buttons**:: - - A Button - Button 0 - B Button - Button 1 - X Button - Button 2 - Y Button - Button 3 - - Button - Button 4 - Home Button - Button 5 - + Button - Button 6 - ZL - Button ? Missing - ZR - Button ? Missing - L. Stick In - Button 9 - R. Stick In - Button 10 - D-pad Up - Button 11 - D-pad Down - Button 12 - D-pad Left - Button 13 - D-pad Right - Button 14 - Capture Button - Button 15 - Right SR - Button 16 - Left SL - Button 17 - Right SL - Button 18 - Left SR - Button 19 - -Nintendo Switch Pro Controller (pygame 2.x) -******************************************* - -The Nintendo Switch Pro Controller has 6 axes, 16 buttons, and 0 hats. -The controller is recognized as "Nintendo Switch Pro Controller". - - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 2 - Up -> Down - Axis 3 - -* **Left Trigger**:: - - Out -> In - Axis 4 - -* **Right Trigger**:: - - Out -> In - Axis 5 - -* **Buttons**:: - - A Button - Button 0 - B Button - Button 1 - X Button - Button 2 - Y Button - Button 3 - - Button - Button 4 - Home Button - Button 5 - + Button - Button 6 - L. Stick In - Button 7 - R. Stick In - Button 8 - Left Bumper - Button 9 - Right Bumper - Button 10 - D-pad Up - Button 11 - D-pad Down - Button 12 - D-pad Left - Button 13 - D-pad Right - Button 14 - Capture Button - Button 15 - - -XBox 360 Controller (pygame 2.x) -******************************** - -The Xbox 360 controller mapping has 6 axes, 11 buttons and 1 hat. -The controller is recognized as "Xbox 360 Controller". - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 3 - Up -> Down - Axis 4 - -* **Left Trigger**:: - - Out -> In - Axis 2 - -* **Right Trigger**:: - - Out -> In - Axis 5 - -* **Buttons**:: - - A Button - Button 0 - B Button - Button 1 - X Button - Button 2 - Y Button - Button 3 - Left Bumper - Button 4 - Right Bumper - Button 5 - Back Button - Button 6 - Start Button - Button 7 - L. Stick In - Button 8 - R. Stick In - Button 9 - Guide Button - Button 10 - -* **Hat/D-pad**:: - - Down -> Up - Y Axis - Left -> Right - X Axis - - -Playstation 4 Controller (pygame 2.x) -************************************* - -The PlayStation 4 controller mapping has 6 axes and 16 buttons. -The controller is recognized as "PS4 Controller". - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 2 - Up -> Down - Axis 3 - -* **Left Trigger**:: - - Out -> In - Axis 4 - -* **Right Trigger**:: - - Out -> In - Axis 5 - -* **Buttons**:: - - Cross Button - Button 0 - Circle Button - Button 1 - Square Button - Button 2 - Triangle Button - Button 3 - Share Button - Button 4 - PS Button - Button 5 - Options Button - Button 6 - L. Stick In - Button 7 - R. Stick In - Button 8 - Left Bumper - Button 9 - Right Bumper - Button 10 - D-pad Up - Button 11 - D-pad Down - Button 12 - D-pad Left - Button 13 - D-pad Right - Button 14 - Touch Pad Click - Button 15 - - -XBox 360 Controller (pygame 1.x) -******************************** - -The Xbox 360 controller mapping has 5 axes, 10 buttons, and 1 hat. -The controller is recognized as "Controller (XBOX 360 For Windows)". - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 4 - Up -> Down - Axis 3 - -* **Left Trigger & Right Trigger**:: - - RT -> LT - Axis 2 - -* **Buttons**:: - - A Button - Button 0 - B Button - Button 1 - X Button - Button 2 - Y Button - Button 3 - Left Bumper - Button 4 - Right Bumper - Button 5 - Back Button - Button 6 - Start Button - Button 7 - L. Stick In - Button 8 - R. Stick In - Button 9 - -* **Hat/D-pad**:: - - Down -> Up - Y Axis - Left -> Right - X Axis - - -Playstation 4 Controller (pygame 1.x) -************************************* - -The PlayStation 4 controller mapping has 6 axes, 14 buttons, and 1 hat. -The controller is recognized as "Wireless Controller". - -* **Left Stick**:: - - Left -> Right - Axis 0 - Up -> Down - Axis 1 - -* **Right Stick**:: - - Left -> Right - Axis 2 - Up -> Down - Axis 3 - -* **Left Trigger**:: - - Out -> In - Axis 5 - -* **Right Trigger**:: - - Out -> In - Axis 4 - -* **Buttons**:: - - Cross Button - Button 0 - Circle Button - Button 1 - Square Button - Button 2 - Triangle Button - Button 3 - Left Bumper - Button 4 - Right Bumper - Button 5 - L. Trigger(Full)- Button 6 - R. Trigger(Full)- Button 7 - Share Button - Button 8 - Options Button - Button 9 - L. Stick In - Button 10 - R. Stick In - Button 11 - PS Button - Button 12 - Touch Pad Click - Button 13 - -* **Hat/D-pad**:: - - Down -> Up - Y Axis - Left -> Right - X Axis +See more about frequently used controllers and joysticks on :doc:`extra_infos/common_joysticks` . \ No newline at end of file diff --git a/docs/reST/ref/surface.rst b/docs/reST/ref/surface.rst index 8132ad0ace..818f376c56 100644 --- a/docs/reST/ref/surface.rst +++ b/docs/reST/ref/surface.rst @@ -297,7 +297,7 @@ specific area. The fill will also be contained by the Surface clip area. The color argument can be an ``RGB`` sequence, an ``RGBA`` sequence, - a string (for :doc:`color_list`), or a mapped color index. If using ``RGBA``, + a string (for :doc:`extra_infos/color_list`), or a mapped color index. If using ``RGBA``, the Alpha (A part of ``RGBA``) is ignored unless the surface uses per pixel alpha (Surface has the ``SRCALPHA`` flag). @@ -332,7 +332,7 @@ Set the current color key for the Surface. When blitting this Surface onto a destination, any pixels that have the same color as the colorkey will be transparent. The color can be an ``RGB`` color, a string - (for :doc:`color_list`), or a mapped color integer. If ``None`` is passed, + (for :doc:`extra_infos/color_list`), or a mapped color integer. If ``None`` is passed, the colorkey will be unset. The colorkey will be ignored if the Surface is formatted to use per pixel @@ -504,7 +504,7 @@ | :sg:`set_at((x, y), color, /) -> None` Set the color of a single pixel at the specified coordinates to be an ``RGB``, - ``RGBA``, string (for :doc:`color_list`), or mapped integer color value. If the Surface + ``RGBA``, string (for :doc:`extra_infos/color_list`), or mapped integer color value. If the Surface does not have per pixel alphas, the alpha value is ignored. Setting pixels outside the Surface area or outside the Surface clipping will have no effect. diff --git a/docs/reST/ref/system.rst b/docs/reST/ref/system.rst index 1d522b49ee..d635712bd5 100644 --- a/docs/reST/ref/system.rst +++ b/docs/reST/ref/system.rst @@ -51,8 +51,7 @@ .. versionadded:: 2.3.1 - .. versionchanged:: 2.4.0 removed ``RDTSC`` key, - as it has been removed in pre-release SDL3 + .. versionchanged:: 2.4.0 removed ``RDTSC`` key, as it has been removed in pre-release SDL3 .. function:: get_total_ram diff --git a/docs/reST/tutorials.rst b/docs/reST/tutorials.rst new file mode 100644 index 0000000000..321a2c31ec --- /dev/null +++ b/docs/reST/tutorials.rst @@ -0,0 +1,15 @@ +Tutorials +========= + +************************************************* + List of pygame tutorials +************************************************* + +.. toctree:: + :maxdepth: 2 + :glob: + + tutorials/en/* + tutorials/en/**/* + tutorials/ko/**/* + tutorials/es/* \ No newline at end of file