This commit is contained in:
wittmannzl103469 committed 2026-11-05 15:08:42 +01:00
1 parent de41a02749
commit 9af09cebd3
764 files changed
+54218 -78859

No files matched your search

@@ -5,15 +5,12 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Pygame-ce Front Page &#8212; pygame-ce v2.5.8 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/pygame.css?v=a9f2cf0f" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
<script src="_static/documentation_options.js?v=1fd526c0"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<title>Pygame Front Page &#8212; pygame v2.6.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/pygame.css?v=a854c6a8" />
<script src="_static/documentation_options.js?v=0a414f3d"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/script.js?v=57918e6b"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="icon" href="_static/pygame.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
@@ -25,30 +22,24 @@
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://pyga.me/docs">
<img src="_static/pygame_ce_tiny.webp"/>
<a href="https://www.pygame.org/">
<img src="_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame-ce documentation</h5>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<div class="nav-top-wrapper">
<a href="https://pyga.me/docs">Pygame-ce Home</a> ||
<a href="#">Help Contents</a> ||
<a href="genindex.html">Reference Index</a>
</div>
<div class="searchbar-container">
<img class="theme-icon" data-theme="dark-theme" src="_static/light-theme-icon.svg" width="24" height="24" alt="Light Theme Icon">
<img class="theme-icon" data-theme="light-theme" src="_static/dark-theme-icon.svg" width="24" height="24" alt="Dark Theme Icon">
<form action="search.html" method="get" class="searchbar-form" style="display:inline;float:right;">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="#">Help Contents</a> ||
<a href="genindex.html">Reference Index</a>
<form action="search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<img class="searchbar-button" src="_static/searchbar-icon.svg" alt="Search">
<input class="searchbar-submit" value="search" type="submit">
<input value="search" type="submit">
</form>
</div>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><b>Most useful stuff</b>:
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="ref/color.html">Color</a> |
<a href="ref/display.html">display</a> |
<a href="ref/draw.html">draw</a> |
@@ -66,7 +57,7 @@
<a href="ref/pygame.html">pygame</a>
</p>
<p class="bottom"><b>Advanced stuff</b>:
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="ref/cursors.html">cursors</a> |
<a href="ref/joystick.html">joystick</a> |
<a href="ref/mask.html">mask</a> |
@@ -83,17 +74,15 @@
<a href="ref/math.html">math</a>
</p>
<p class="bottom"><b>Other</b>:
<p class="bottom"><strong>Other</strong>:
<a href="ref/camera.html">camera</a> |
<a href="ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="ref/examples.html">examples</a> |
<a href="ref/fastevent.html">fastevent</a> |
<a href="ref/scrap.html">scrap</a> |
<a href="ref/system.html">system</a> |
<a href="ref/tests.html">tests</a> |
<a href="ref/touch.html">touch</a> |
<a href="ref/typing.html">typing</a> |
<a href="ref/pygame.html#module-pygame.version">version</a> |
<a href="ref/window.html">Window</a>
<a href="ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
@@ -102,20 +91,19 @@
<div class="documentwrapper">
<div class="body" role="main">
<section id="pygame-ce-front-page">
<h1>Pygame-ce Front Page<a class="headerlink" href="#pygame-ce-front-page" title="Link to this heading"></a></h1>
<section id="pygame-front-page">
<h1>Pygame Front Page<a class="headerlink" href="#pygame-front-page" title="Link to this heading"></a></h1>
<div class="toctree-wrapper compound">
</div>
<section id="quick-start">
<h2>Quick start<a class="headerlink" href="#quick-start" title="Link to this heading"></a></h2>
<p>Welcome to pygame-ce! Once you've got pygame-ce installed
(<code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">pygame-ce</span></code> or <code class="code docutils literal notranslate"><span class="pre">pip3</span> <span class="pre">install</span> <span class="pre">pygame-ce</span></code> for most
people), the next question is how to get a game loop running. Pygame-ce,
unlike some other libraries, gives you full control of program
<p>Welcome to pygame! Once you've got pygame installed (<code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">pygame</span></code> or
<code class="code docutils literal notranslate"><span class="pre">pip3</span> <span class="pre">install</span> <span class="pre">pygame</span></code> for most people), the next question is how to get a game
loop running. Pygame, unlike some other libraries, gives you full control of program
execution. That freedom means it is easy to mess up in your initial steps.</p>
<p>Here is a good example of a basic setup (opens the window, updates the screen, and handles events)--</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Example file showing a basic pygame &quot;game loop&quot;</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">pygame</span>
<span class="kn">import</span> <span class="nn">pygame</span>
<span class="c1"># pygame setup</span>
<span class="n">pygame</span><span class="o">.</span><span class="n">init</span><span class="p">()</span>
@@ -146,7 +134,7 @@ execution. That freedom means it is easy to mess up in your initial steps.</p>
<p>Here is a slightly more fleshed out example, which shows you how to move something
(a circle in this case) around on screen--</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Example file showing a circle moving on screen</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">pygame</span>
<span class="kn">import</span> <span class="nn">pygame</span>
<span class="c1"># pygame setup</span>
<span class="n">pygame</span><span class="o">.</span><span class="n">init</span><span class="p">()</span>
@@ -191,37 +179,16 @@ execution. That freedom means it is easy to mess up in your initial steps.</p>
</pre></div>
</div>
<p>For more in depth reference, check out the <a class="reference internal" href="#tutorials-reference-label"><span class="std std-ref">Tutorials</span></a>
section below, or reference the API documentation by module.</p>
</section>
<section id="experimental-modules">
<h2>Experimental modules<a class="headerlink" href="#experimental-modules" title="Link to this heading"></a></h2>
<p>Experimental modules are work in progress, this is why you should refrain from relying on any features
provided by these modules, as they are subject to change or removal without prior notice.
If you want to test these experimental modules, you might want to understand how you import
them, this is how you can do it:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">pygame</span><span class="w"> </span><span class="kn">import</span> <span class="n">experimental_module</span>
<span class="c1"># Or for specific modules like _sdl2.controller</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">pygame._sdl2</span><span class="w"> </span><span class="kn">import</span> <span class="n">controller</span>
<span class="c1"># Or</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">pygame.experimental_module</span>
</pre></div>
</div>
<p>Don't forget to report us any problem with the experimental features on <a class="reference external" href="https://github.com/pygame-community/pygame-ce">github</a> so we can easily
turn them to stable API in the future ^^.</p>
<p><strong>Below is currently the list of experimental modules :</strong></p>
<dl class="simple">
<dt><a class="reference internal" href="ref/geometry.html"><span class="doc">pygame.geometry</span></a></dt><dd><p>Pygame module for the Circle, Line, and Polygon objects.</p>
</dd>
<dt><a class="reference internal" href="ref/sdl2_controller.html"><span class="doc">pygame._sdl2.controller</span></a></dt><dd><p>Pygame module to work with controllers.</p>
</dd>
<dt><a class="reference internal" href="ref/sdl2_video.html"><span class="doc">pygame.sdl2_video</span></a></dt><dd><p>Pygame module for porting new SDL video systems.</p>
</dd>
</dl>
section below, check out a video tutorial (<a class="reference external" href="https://www.youtube.com/watch?v=AY9MnQ4x3zk">I'm a fan of this one</a>), or reference the API
documentation by module.</p>
</section>
<section id="documents">
<h2>Documents<a class="headerlink" href="#documents" title="Link to this heading"></a></h2>
<dl class="simple">
<dt><a class="reference external" href="https://github.com/pygame-community/pygame-ce#readme">Readme</a></dt><dd><p>Basic information about pygame: what it is, who is involved, and where to find it.</p>
<dt><a class="reference external" href="../wiki/about">Readme</a></dt><dd><p>Basic information about pygame: what it is, who is involved, and where to find it.</p>
</dd>
<dt><a class="reference external" href="../wiki/GettingStarted#Pygame%20Installation">Install</a></dt><dd><p>Steps needed to compile pygame on several platforms.
Also help on finding and installing prebuilt binaries for your system.</p>
</dd>
<dt><a class="reference internal" href="filepaths.html"><span class="doc">File Path Function Arguments</span></a></dt><dd><p>How pygame handles file system paths.</p>
</dd>
@@ -235,63 +202,41 @@ Generally, if pygame is not changed, it can be used with any type of program.</p
</section>
<section id="tutorials">
<span id="tutorials-reference-label"></span><h2>Tutorials<a class="headerlink" href="#tutorials" title="Link to this heading"></a></h2>
<div class="line-block">
<div class="line"><a class="reference external" href="https://www.youtube.com/watch?v=8OMghdHP-zs">Master Python by making 5 games [the new ultimate introduction to pygame]</a></div>
<div class="line-block">
<div class="line">YouTube video by Clear Code.</div>
</div>
</div>
<div class="line-block">
<div class="line"><a class="reference external" href="https://www.youtube.com/watch?v=blLLtdv4tvo">Pygame in 18 Minutes</a></div>
<div class="line-block">
<div class="line">YouTube video by DaFluffyPotato.</div>
</div>
</div>
<div class="line-block">
<div class="line"><a class="reference external" href="https://github.com/adamsralf/pygame_book/blob/main/00%20pygamece.pdf">Introduction to Pygame-ce, 2D game programming</a></div>
<div class="line-block">
<div class="line">Book by Ralf Adams.</div>
</div>
</div>
<dl class="simple">
<dt><a class="reference internal" href="tutorials/en/newbie-guide.html"><span class="doc">Newbie Guide</span></a></dt><dd><p>A list of thirteen helpful tips for people to get comfortable using pygame.</p>
<dt><a class="reference internal" href="tut/PygameIntro.html"><span class="doc">Introduction to Pygame</span></a></dt><dd><p>An introduction to the basics of pygame.
This is written for users of Python and appeared in volume two of the Py magazine.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/import-init.html"><span class="doc">Import and Initialize</span></a></dt><dd><p>The beginning steps on importing and initializing pygame.
<dt><a class="reference internal" href="tut/ImportInit.html"><span class="doc">Import and Initialize</span></a></dt><dd><p>The beginning steps on importing and initializing pygame.
The pygame package is made of several modules.
Some modules are not included on all platforms.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/move-it.html"><span class="doc">How do I move an Image?</span></a></dt><dd><p>A basic tutorial that covers the concepts behind 2D computer animation.
<dt><a class="reference internal" href="tut/MoveIt.html"><span class="doc">How do I move an Image?</span></a></dt><dd><p>A basic tutorial that covers the concepts behind 2D computer animation.
Information about drawing and clearing objects to make them appear animated.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/chimp-explanation.html"><span class="doc">Chimp Tutorial, Line by Line</span></a></dt><dd><p>The pygame examples include a simple program with an interactive fist and a chimpanzee.
<dt><a class="reference internal" href="tut/ChimpLineByLine.html"><span class="doc">Chimp Tutorial, Line by Line</span></a></dt><dd><p>The pygame examples include a simple program with an interactive fist and a chimpanzee.
This was inspired by the annoying flash banner of the early 2000s.
This tutorial examines every line of code used in the example.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/premultiplied-alpha.html"><span class="doc">What is Premultiplied Alpha?</span></a></dt><dd><p>An explanation of alpha compositing and the advantages of using premultiplied alpha.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/intro-to-sprites.html"><span class="doc">Sprite Module Introduction</span></a></dt><dd><p>Pygame includes a higher level sprite module to help organize games.
<dt><a class="reference internal" href="tut/SpriteIntro.html"><span class="doc">Sprite Module Introduction</span></a></dt><dd><p>Pygame includes a higher level sprite module to help organize games.
The sprite module includes several classes that help manage details found in almost all games types.
The Sprite classes are a bit more advanced than the regular pygame modules,
and need more understanding to be properly used.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/intro-to-pygame.html"><span class="doc">Introduction to Pygame</span></a></dt><dd><p>An introduction to the basics of pygame.
This is written for users of Python and appeared in volume two of the Py magazine.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/intro-to-surfarray.html"><span class="doc">Surfarray Introduction</span></a></dt><dd><p>Pygame used the NumPy python module to allow efficient per pixel effects on images.
<dt><a class="reference internal" href="tut/SurfarrayIntro.html"><span class="doc">Surfarray Introduction</span></a></dt><dd><p>Pygame used the NumPy python module to allow efficient per pixel effects on images.
Using the surface arrays is an advanced feature that allows custom effects and filters.
This also examines some of the simple effects from the pygame example, arraydemo.py.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/intro-to-camera.html"><span class="doc">Camera Module Introduction</span></a></dt><dd><p>Pygame, as of 1.9, has a camera module that allows you to capture images,
<dt><a class="reference internal" href="tut/CameraIntro.html"><span class="doc">Camera Module Introduction</span></a></dt><dd><p>Pygame, as of 1.9, has a camera module that allows you to capture images,
watch live streams, and do some basic computer vision.
This tutorial covers those use cases.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/make-games.html"><span class="doc">Making Games Tutorial</span></a></dt><dd><p>A large tutorial that covers the bigger topics needed to create an entire game.</p>
<dt><a class="reference internal" href="tut/newbieguide.html"><span class="doc">Newbie Guide</span></a></dt><dd><p>A list of thirteen helpful tips for people to get comfortable using pygame.</p>
</dd>
<dt><a class="reference internal" href="tutorials/en/display-modes.html"><span class="doc">Display Modes</span></a></dt><dd><p>Getting a display surface for the screen.</p>
<dt><a class="reference internal" href="tut/MakeGames.html"><span class="doc">Making Games Tutorial</span></a></dt><dd><p>A large tutorial that covers the bigger topics needed to create an entire game.</p>
</dd>
<dt><a class="reference internal" href="tutorials/es/ChimpanceLineaporLinea.html"><span class="doc">Tutorial de Pygame - Ejemplo del Chimpancé, Línea Por Línea</span></a></dt><dd><p>Los ejemplos de pygame incluyen un sencillo programa con un puño interactivo y un chimpancé.
Está inspirado en el molesto banner de flash de principios de la década de 2000.
Este tutorial examina cada línea de código utilizada en el ejemplo.</p>
<dt><a class="reference internal" href="tut/DisplayModes.html"><span class="doc">Display Modes</span></a></dt><dd><p>Getting a display surface for the screen.</p>
</dd>
<dt><a class="reference internal" href="tut/ko/%EB%B9%A8%EA%B0%84%EB%B8%94%EB%A1%9D%20%EA%B2%80%EC%9D%80%EB%B8%94%EB%A1%9D/%EA%B0%9C%EC%9A%94.html"><span class="doc">한국어 튜토리얼 (Korean Tutorial)</span></a></dt><dd><p>빨간블록 검은블록</p>
</dd>
</dl>
</section>
@@ -356,10 +301,6 @@ Este tutorial examina cada línea de código utilizada en el ejemplo.</p>
</dd>
<dt><a class="reference internal" href="ref/transform.html"><span class="doc">pygame.transform</span></a></dt><dd><p>Resize and move images.</p>
</dd>
<dt><a class="reference internal" href="ref/typing.html"><span class="doc">pygame.typing</span></a></dt><dd><p>Provide common typehints</p>
</dd>
<dt><a class="reference internal" href="ref/window.html"><span class="doc">pygame.Window</span></a></dt><dd><p>Pygame object that handles a window.</p>
</dd>
<dt><a class="reference internal" href="c_api.html"><span class="doc">pygame C API</span></a></dt><dd><p>The C api shared amongst pygame extension modules.</p>
</dd>
<dt><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></dt><dd><p>Search pygame documents by keyword.</p>
@@ -371,7 +312,7 @@ Este tutorial examina cada línea de código utilizada en el ejemplo.</p>
<br /><br />
<hr />
<a href="https://github.com/pygame-community/pygame-ce/edit/main/docs/reST/index.rst" rel="nofollow">Edit on GitHub</a>
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/index.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
@@ -389,12 +330,14 @@ Este tutorial examina cada línea de código utilizada en el ejemplo.</p>
<li class="right" >
<a href="ref/bufferproxy.html" title="pygame.BufferProxy"
accesskey="N">next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">pygame-ce v2.5.8 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Pygame-ce Front Page</a></li>
<li class="nav-item nav-item-0"><a href="#">pygame v2.6.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Pygame Front Page</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2022, pygame developers, 2023 pygame-ce developers.
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>