Skip to content

Commit 9ad9e71

Browse files
committed
Pygame
1 parent 3b413d5 commit 9ad9e71

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,11 +2935,11 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
29352935
<Rect> = pg.Rect(topleft_x, topleft_y, width, height)
29362936
<int> = <Rect>.x/y/centerx/centery
29372937
<tup.> = <Rect>.topleft/topright/bottomright/bottomleft/center
2938-
<Rect> = <Rect>.move(<tuple>)
2938+
<Rect> = <Rect>.move((x, y))
29392939
```
29402940

29412941
```python
2942-
<bool> = <Rect>.collidepoint(<tuple>) # Tests if a point is inside a rectangle.
2942+
<bool> = <Rect>.collidepoint((x, y)) # Tests if a point is inside a rectangle.
29432943
<bool> = <Rect>.colliderect(<Rect>) # Tests if two rectangles overlap.
29442944
<int> = <Rect>.collidelist(<list_of_Rect>) # Returns index of first colliding Rect or -1.
29452945
<list> = <Rect>.collidelistall(<list_of_Rect>) # Returns indices of all colliding Rects.
@@ -2955,8 +2955,8 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
29552955
```
29562956

29572957
```python
2958-
<Surf>.set_at((x, y), color) # Updates pixel.
29592958
<Surf>.fill(color) # Fills the whole surface.
2959+
<Surf>.set_at((x, y), color) # Updates pixel.
29602960
<Surf>.blit(<Surface>, (x, y)) # Draws passed surface to the surface.
29612961
```
29622962

@@ -2967,7 +2967,7 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
29672967
```
29682968

29692969
```python
2970-
pg.draw.line(<Surf>, color, start_pos, end_pos, width)
2970+
pg.draw.line(<Surf>, color, (x1, y1), (x2, y2), width)
29712971
pg.draw.arc(<Surf>, color, <Rect>, start_radians, stop_radians)
29722972
pg.draw.rect(<Surf>, color, <Rect>)
29732973
pg.draw.polygon(<Surf>, color, points)
@@ -2976,7 +2976,7 @@ pg.draw.ellipse(<Surf>, color, <Rect>)
29762976

29772977
### Font
29782978
```python
2979-
<Font> = pg.font.SysFont(name, size, bold=False, italic=False)
2979+
<Font> = pg.font.SysFont('<name>', size, bold=False, italic=False)
29802980
<Font> = pg.font.Font('<path>', size)
29812981
<Surf> = <Font>.render(text, antialias, color, background=None)
29822982
```

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,11 +2496,11 @@
24962496
<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(topleft_x, topleft_y, width, height)
24972497
&lt;int&gt; = &lt;Rect&gt;.x/y/centerx/centery
24982498
&lt;tup.&gt; = &lt;Rect&gt;.topleft/topright/bottomright/bottomleft/center
2499-
&lt;Rect&gt; = &lt;Rect&gt;.move(&lt;tuple&gt;)
2499+
&lt;Rect&gt; = &lt;Rect&gt;.move((x, y))
25002500
</code></pre></div>
25012501

25022502

2503-
<pre><code class="python language-python hljs">&lt;bool&gt; = &lt;Rect&gt;.collidepoint(&lt;tuple&gt;) <span class="hljs-comment"># Tests if a point is inside a rectangle.</span>
2503+
<pre><code class="python language-python hljs">&lt;bool&gt; = &lt;Rect&gt;.collidepoint((x, y)) <span class="hljs-comment"># Tests if a point is inside a rectangle.</span>
25042504
&lt;bool&gt; = &lt;Rect&gt;.colliderect(&lt;Rect&gt;) <span class="hljs-comment"># Tests if two rectangles overlap.</span>
25052505
&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>
25062506
&lt;list&gt; = &lt;Rect&gt;.collidelistall(&lt;list_of_Rect&gt;) <span class="hljs-comment"># Returns indices of all colliding Rects.</span>
@@ -2512,21 +2512,21 @@
25122512
</code></pre></div>
25132513

25142514

2515-
<pre><code class="python language-python hljs">&lt;Surf&gt;.set_at((x, y), color) <span class="hljs-comment"># Updates pixel.</span>
2516-
&lt;Surf&gt;.fill(color) <span class="hljs-comment"># Fills the whole surface.</span>
2515+
<pre><code class="python language-python hljs">&lt;Surf&gt;.fill(color) <span class="hljs-comment"># Fills the whole surface.</span>
2516+
&lt;Surf&gt;.set_at((x, y), color) <span class="hljs-comment"># Updates pixel.</span>
25172517
&lt;Surf&gt;.blit(&lt;Surface&gt;, (x, y)) <span class="hljs-comment"># Draws passed surface to the surface.</span>
25182518
</code></pre>
25192519
<pre><code class="python language-python hljs">&lt;Surf&gt; = pg.transform.flip(&lt;Surf&gt;, xbool, ybool)
25202520
&lt;Surf&gt; = pg.transform.rotate(&lt;Surf&gt;, degrees)
25212521
&lt;Surf&gt; = pg.transform.scale(&lt;Surf&gt;, (width, height))
25222522
</code></pre>
2523-
<pre><code class="python language-python hljs">pg.draw.line(&lt;Surf&gt;, color, start_pos, end_pos, width)
2523+
<pre><code class="python language-python hljs">pg.draw.line(&lt;Surf&gt;, color, (x1, y1), (x2, y2), width)
25242524
pg.draw.arc(&lt;Surf&gt;, color, &lt;Rect&gt;, start_radians, stop_radians)
25252525
pg.draw.rect(&lt;Surf&gt;, color, &lt;Rect&gt;)
25262526
pg.draw.polygon(&lt;Surf&gt;, color, points)
25272527
pg.draw.ellipse(&lt;Surf&gt;, color, &lt;Rect&gt;)
25282528
</code></pre>
2529-
<div><h3 id="font">Font</h3><pre><code class="python language-python hljs">&lt;Font&gt; = pg.font.SysFont(name, size, bold=<span class="hljs-keyword">False</span>, italic=<span class="hljs-keyword">False</span>)
2529+
<div><h3 id="font">Font</h3><pre><code class="python language-python hljs">&lt;Font&gt; = pg.font.SysFont(<span class="hljs-string">'&lt;name&gt;'</span>, size, bold=<span class="hljs-keyword">False</span>, italic=<span class="hljs-keyword">False</span>)
25302530
&lt;Font&gt; = pg.font.Font(<span class="hljs-string">'&lt;path&gt;'</span>, size)
25312531
&lt;Surf&gt; = &lt;Font&gt;.render(text, antialias, color, background=<span class="hljs-keyword">None</span>)
25322532
</code></pre></div>

0 commit comments

Comments
 (0)