Browse Source

Pygame

pull/152/head
Jure Šorn 2 years ago
parent
commit
5c0f1130ca
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -2985,7 +2985,7 @@ while not pg.event.get(pg.QUIT):
<Rect> = pg.Rect(x, y, width, height) # Floats get truncated into ints.
<int> = <Rect>.x/y/centerx/centery/… # Top, right, bottom, left. Allows assignments.
<tup.> = <Rect>.topleft/center/… # Topright, bottomright, bottomleft. Same.
<Rect> = <Rect>.move((x, y)) # Use move_ip() to move in-place.
<Rect> = <Rect>.move((delta_x, delta_y)) # Use move_ip() to move in-place.
```
```python
@ -2998,7 +2998,7 @@ while not pg.event.get(pg.QUIT):
### Surface
**Object for representing images.**
```python
<Surf> = pg.display.set_mode((width, height)) # Returns a display surface.
<Surf> = pg.display.set_mode((width, height)) # Opens new window and returns its surface.
<Surf> = pg.Surface((width, height)) # New RGB surface. RGBA if `flags=pg.SRCALPHA`.
<Surf> = pg.image.load('<path>') # Loads the image. Format depends on source.
<Surf> = <Surf>.subsurface(<Rect>) # Returns a subsurface.

4
index.html

@ -2437,7 +2437,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2
<div><h3 id="rectangle">Rectangle</h3><p><strong>Object for storing rectangular coordinates.</strong></p><pre><code class="python language-python hljs">&lt;Rect&gt; = pg.Rect(x, y, width, height) <span class="hljs-comment"># Floats get truncated into ints.</span>
&lt;int&gt; = &lt;Rect&gt;.x/y/centerx/centery/… <span class="hljs-comment"># Top, right, bottom, left. Allows assignments.</span>
&lt;tup.&gt; = &lt;Rect&gt;.topleft/center/… <span class="hljs-comment"># Topright, bottomright, bottomleft. Same.</span>
&lt;Rect&gt; = &lt;Rect&gt;.move((x, y)) <span class="hljs-comment"># Use move_ip() to move in-place.</span>
&lt;Rect&gt; = &lt;Rect&gt;.move((delta_x, delta_y)) <span class="hljs-comment"># Use move_ip() to move in-place.</span>
</code></pre></div>
@ -2446,7 +2446,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2
&lt;int&gt; = &lt;Rect&gt;.collidelist(&lt;list_of_Rect&gt;) <span class="hljs-comment"># Returns index of first colliding Rect or -1.</span>
&lt;list&gt; = &lt;Rect&gt;.collidelistall(&lt;list_of_Rect&gt;) <span class="hljs-comment"># Returns indexes of all colliding rectangles.</span>
</code></pre>
<div><h3 id="surface">Surface</h3><p><strong>Object for representing images.</strong></p><pre><code class="python language-python hljs">&lt;Surf&gt; = pg.display.set_mode((width, height)) <span class="hljs-comment"># Returns a display surface.</span>
<div><h3 id="surface">Surface</h3><p><strong>Object for representing images.</strong></p><pre><code class="python language-python hljs">&lt;Surf&gt; = pg.display.set_mode((width, height)) <span class="hljs-comment"># Opens new window and returns its surface.</span>
&lt;Surf&gt; = pg.Surface((width, height)) <span class="hljs-comment"># New RGB surface. RGBA if `flags=pg.SRCALPHA`.</span>
&lt;Surf&gt; = pg.image.load(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-comment"># Loads the image. Format depends on source.</span>
&lt;Surf&gt; = &lt;Surf&gt;.subsurface(&lt;Rect&gt;) <span class="hljs-comment"># Returns a subsurface.</span>

Loading…
Cancel
Save