Browse Source

Pygame

pull/109/merge
Jure Šorn 1 year ago
parent
commit
c58b381122
2 changed files with 6 additions and 6 deletions
  1. 6
      README.md
  2. 6
      index.html

6
README.md

@ -3045,14 +3045,14 @@ rect(<Surf>, color, <Rect>, width=0) # Also polygon(<Surf>, color, po
### Font
```python
<Font> = pg.font.Font(<path/file>, size) # Loads the TTF file. Pass None for default.
<Font> = pg.font.Font(<path/file>, size) # Loads TTF file. Pass None for default font.
<Surf> = <Font>.render(text, antialias, color) # Background color can be specified at the end.
```
### Sound
```python
<Sound> = pg.mixer.Sound(<path/file/bytes>) # Loads the WAV file or array of signed shorts.
<Sound>.play() # Starts playing the sound.
<Sound> = pg.mixer.Sound(<path/file/bytes>) # Loads WAV file or array of signed shorts.
<Sound>.play/stop() # Also <Sound>.set_volume(<float>).
```
### Basic Mario Brothers Example

6
index.html

@ -2482,12 +2482,12 @@ line(&lt;Surf&gt;, color, (x1, y1), (x2, y2), width) <span class="hljs-comment"
arc(&lt;Surf&gt;, color, &lt;Rect&gt;, from_rad, to_rad) <span class="hljs-comment"># Also ellipse(&lt;Surf&gt;, color, &lt;Rect&gt;, width=0).</span>
rect(&lt;Surf&gt;, color, &lt;Rect&gt;, width=<span class="hljs-number">0</span>) <span class="hljs-comment"># Also polygon(&lt;Surf&gt;, color, points, width=0).</span>
</code></pre>
<div><h3 id="font">Font</h3><pre><code class="python language-python hljs">&lt;Font&gt; = pg.font.Font(&lt;path/file&gt;, size) <span class="hljs-comment"># Loads the TTF file. Pass None for default.</span>
<div><h3 id="font">Font</h3><pre><code class="python language-python hljs">&lt;Font&gt; = pg.font.Font(&lt;path/file&gt;, size) <span class="hljs-comment"># Loads TTF file. Pass None for default font.</span>
&lt;Surf&gt; = &lt;Font&gt;.render(text, antialias, color) <span class="hljs-comment"># Background color can be specified at the end.</span>
</code></pre></div>
<div><h3 id="sound">Sound</h3><pre><code class="python language-python hljs">&lt;Sound&gt; = pg.mixer.Sound(&lt;path/file/bytes&gt;) <span class="hljs-comment"># Loads the WAV file or array of signed shorts.</span>
&lt;Sound&gt;.play() <span class="hljs-comment"># Starts playing the sound.</span>
<div><h3 id="sound">Sound</h3><pre><code class="python language-python hljs">&lt;Sound&gt; = pg.mixer.Sound(&lt;path/file/bytes&gt;) <span class="hljs-comment"># Loads WAV file or array of signed shorts.</span>
&lt;Sound&gt;.play/stop() <span class="hljs-comment"># Also &lt;Sound&gt;.set_volume(&lt;float&gt;).</span>
</code></pre></div>
<div><h3 id="basicmariobrothersexample">Basic Mario Brothers Example</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> collections, dataclasses, enum, io, itertools <span class="hljs-keyword">as</span> it, pygame <span class="hljs-keyword">as</span> pg, urllib.request

Loading…
Cancel
Save