|
1 | 1 | .. module:: sdl2.ext |
2 | | - :synopsis: Python extensions for SDL2 |
| 2 | + :synopsis: Helpful wrappers for the SDL2 API |
3 | 3 |
|
4 | | -sdl2.ext - Python extensions for SDL2 |
5 | | -===================================== |
6 | | -The :mod:`sdl2.ext` package provides advanced functionality for creating |
7 | | -applications using SDL2 and Python. It offers a rich set of modules, classes |
8 | | -and functions, such as easy image loading, basic user interface elements, |
9 | | -resource management and sprite and (on-screen) scene systems. |
| 4 | +sdl2.ext - Helpful wrappers for the SDL2 API |
| 5 | +============================================ |
10 | 6 |
|
11 | | -Learn more about |
| 7 | +The :mod:`sdl2.ext` module provides a rich set of modules, classes, and |
| 8 | +functions for creating games and other applications using PySDL2. |
| 9 | + |
| 10 | +The aim of the `sdl2.ext` module is to wrap commonly-used parts of the SDL2 API |
| 11 | +in a more friendly and Pythonic manner, reducing the need for developers to |
| 12 | +understand the intricacies of working with ``ctypes`` and making it simpler and |
| 13 | +more fun to get PySDL2 programs up and running. |
| 14 | + |
| 15 | +In addition, this module provides a number of template classes and utility |
| 16 | +functions for working with colors, input events, file assets, and more. |
| 17 | + |
| 18 | +Due to its broad scope, the :mod:`sdl2.ext` module is divided into a number of |
| 19 | +submodules. However, everything in these submodules can be imported directly |
| 20 | +from :mod:`sdl2.ext`. For example, ``from sdl2.ext import Window`` is exactly |
| 21 | +the same as ``from sdl2.ext.window import Window``. |
| 22 | + |
| 23 | + |
| 24 | +SDL2 module wrappers |
| 25 | +-------------------- |
| 26 | + |
| 27 | +Some parts of the :mod:`sdl2.ext` module contain Pythonic wrappers for common |
| 28 | +and/or unpleasant parts of the SDL2 API. At present, these modules include: |
| 29 | + |
| 30 | +.. toctree:: |
| 31 | + :maxdepth: 1 |
| 32 | + |
| 33 | + ext/common.rst |
| 34 | + ext/window.rst |
| 35 | + ext/renderer.rst |
| 36 | + ext/msgbox.rst |
| 37 | + |
| 38 | + |
| 39 | +Utilities for working with SDL2 in Python |
| 40 | +----------------------------------------- |
| 41 | + |
| 42 | +Other parts of this module implement functions and classes that make it easier |
| 43 | +to work with SDL2 functions and data structures in Python (and vice versa). |
| 44 | +These include functions for converting text to and from UTF8-encoded bytes, |
| 45 | +reading and writing ``ctypes`` arrays, and casting :obj:`~sdl2.SDL_Surface` |
| 46 | +objects to Numpy arrays: |
| 47 | + |
| 48 | +.. toctree:: |
| 49 | + :maxdepth: 1 |
| 50 | + |
| 51 | + ext/compat.rst |
| 52 | + ext/array.rst |
| 53 | + ext/pixelaccess.rst |
| 54 | + |
| 55 | + |
| 56 | +SDL2-based extensions |
| 57 | +--------------------- |
| 58 | + |
| 59 | +In addition to simple Pythonic wrappers for SDL2 functions and structures, the |
| 60 | +:mod:`sdl2.ext` module also offers a number of high-level classes and functions |
| 61 | +that use SDL2 internally to provide APIs for font rendering, building GUIs, |
| 62 | +importing images, and more: |
| 63 | + |
| 64 | +.. toctree:: |
| 65 | + :maxdepth: 1 |
| 66 | + |
| 67 | + ext/surface.rst |
| 68 | + ext/draw.rst |
| 69 | + ext/image.rst |
| 70 | + ext/ttf.rst |
| 71 | + ext/bitmapfont.rst |
| 72 | + |
| 73 | + |
| 74 | +Useful helpers for building apps |
| 75 | +-------------------------------- |
| 76 | + |
| 77 | +Beyond wrappers and utilities for working with SDL2's API, the |
| 78 | +:mod:`sdl2.ext` module also includes a number of submodules with various |
| 79 | +functions and classes to help facilitate general game and app development with |
| 80 | +PySDL2. These include classes for managing program resource files, working |
| 81 | +with colors, and more: |
| 82 | + |
| 83 | +.. toctree:: |
| 84 | + :maxdepth: 1 |
| 85 | + |
| 86 | + ext/resources.rst |
| 87 | + ext/color.rst |
| 88 | + ext/colorpalettes.rst |
| 89 | + ext/algorithms.rst |
| 90 | + |
| 91 | + |
| 92 | +Component-Oriented Systems |
| 93 | +-------------------------- |
| 94 | + |
| 95 | +PySDL2 contains several modules designed around the concept of |
| 96 | +component-oriented game programming. These modules define various types of |
| 97 | +"systems" for processing events and "factories" for creating different types |
| 98 | +of objects, among other things. |
| 99 | + |
| 100 | +.. note:: |
| 101 | + These modules are not regularly maintained, and their documentation |
| 102 | + may be inaccurate or out-of-date. |
12 | 103 |
|
13 | 104 | .. toctree:: |
14 | 105 | :maxdepth: 1 |
15 | | - :glob: |
16 | 106 |
|
17 | | - ext/* |
| 107 | + ext/ebs.rst |
| 108 | + ext/events.rst |
| 109 | + ext/spritesystem.rst |
| 110 | + ext/uisystem.rst |
| 111 | + ext/particles.rst |
0 commit comments