Browse Source

Pygame

pull/192/head
Jure Šorn 4 months ago
parent
commit
b85b689977
2 changed files with 3 additions and 3 deletions
  1. 4
      README.md
  2. 2
      index.html

4
README.md

@ -3008,10 +3008,10 @@ while not pg.event.get(pg.QUIT):
pg.display.flip()
```
### Rectangle
### Rect
**Object for storing rectangular coordinates.**
```python
<Rect> = pg.Rect(x, y, width, height) # Returns a rectangle. Floats get truncated.
<Rect> = pg.Rect(x, y, width, height) # Creates Rect object. Truncates passed floats.
<int> = <Rect>.x/y/centerx/centery/… # Top, right, bottom, left. Allows assignments.
<tup.> = <Rect>.topleft/center/… # Topright, bottomright, bottomleft. Same.
<Rect> = <Rect>.move((delta_x, delta_y)) # Use move_ip() to move in-place.

2
index.html

@ -2451,7 +2451,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2
pg.display.flip()
</code></pre></div>
<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"># Returns a rectangle. Floats get truncated.</span>
<div><h3 id="rect">Rect</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"># Creates Rect object. Truncates passed floats.</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((delta_x, delta_y)) <span class="hljs-comment"># Use move_ip() to move in-place.</span>

Loading…
Cancel
Save