Browse Source

PyGame

pull/52/head
Jure Šorn 4 years ago
parent
commit
c88b949441
2 changed files with 6 additions and 16 deletions
  1. 10
      README.md
  2. 12
      index.html

10
README.md

@ -2935,11 +2935,7 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
<Rect> = pg.Rect(topleft_x, topleft_y, width, height)
<tuple> = <Rect>.topleft/topright/bottomright/bottomleft/center
<int> = <Rect>.x/y/centerx/centery
```
```python
<Rect> = <Rect>.move(<tuple>) # Or: <Rect>.move(<int>, <int>)
<Rect>.move_ip(<tuple>) # Or: <Rect>.move_ip(<int>, <int>)
```
```python
@ -2971,13 +2967,11 @@ indices = <Rect>.collidelistall(<list_of_Rect>) # Returns indices of all colind
```
```python
pg.draw.line(<Surface>, color, start_pos, end_pos, width)
pg.draw.arc(<Surface>, color, <Rect>, start_angle, stop_angle)
pg.draw.rect(<Surface>, color, <Rect>)
pg.draw.polygon(<Surface>, color, points)
pg.draw.circle(<Surface>, color, center, radius)
pg.draw.ellipse(<Surface>, color, <Rect>)
pg.draw.arc(<Surface>, color, <Rect>, start_angle, stop_angle)
pg.draw.line(<Surface>, color, start_pos, end_pos, width)
pg.draw.lines(<Surface>, color, points)
```
### Font

12
index.html

@ -2496,12 +2496,10 @@ rect = pg.Rect(<span class="hljs-number">235</span>, <span class="hljs-number">2
<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)
&lt;tuple&gt; = &lt;Rect&gt;.topleft/topright/bottomright/bottomleft/center
&lt;int&gt; = &lt;Rect&gt;.x/y/centerx/centery
&lt;Rect&gt; = &lt;Rect&gt;.move(&lt;tuple&gt;) <span class="hljs-comment"># Or: &lt;Rect&gt;.move(&lt;int&gt;, &lt;int&gt;)</span>
</code></pre></div>
<pre><code class="python language-python hljs">&lt;Rect&gt; = &lt;Rect&gt;.move(&lt;tuple&gt;) <span class="hljs-comment"># Or: &lt;Rect&gt;.move(&lt;int&gt;, &lt;int&gt;)</span>
&lt;Rect&gt;.move_ip(&lt;tuple&gt;) <span class="hljs-comment"># Or: &lt;Rect&gt;.move_ip(&lt;int&gt;, &lt;int&gt;)</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;bool&gt; = &lt;Rect&gt;.collidepoint(&lt;tuple&gt;) <span class="hljs-comment"># Or: &lt;Rect&gt;.collidepoint(&lt;int&gt;, &lt;int&gt;)</span>
&lt;bool&gt; = &lt;Rect&gt;.colliderect(&lt;Rect&gt;)
index = &lt;Rect&gt;.collidelist(&lt;list_of_Rect&gt;) <span class="hljs-comment"># Returns index of first coliding Rect or -1.</span>
@ -2522,13 +2520,11 @@ indices = &lt;Rect&gt;.collidelistall(&lt;list_of_Rect&gt;) <span class="hljs-c
&lt;Surface&gt; = pg.transform.rotate(&lt;Surface&gt;, angle)
&lt;Surface&gt; = pg.transform.scale(&lt;Surface&gt;, (width, height))
</code></pre>
<pre><code class="python language-python hljs">pg.draw.rect(&lt;Surface&gt;, color, &lt;Rect&gt;)
<pre><code class="python language-python hljs">pg.draw.line(&lt;Surface&gt;, color, start_pos, end_pos, width)
pg.draw.arc(&lt;Surface&gt;, color, &lt;Rect&gt;, start_angle, stop_angle)
pg.draw.rect(&lt;Surface&gt;, color, &lt;Rect&gt;)
pg.draw.polygon(&lt;Surface&gt;, color, points)
pg.draw.circle(&lt;Surface&gt;, color, center, radius)
pg.draw.ellipse(&lt;Surface&gt;, color, &lt;Rect&gt;)
pg.draw.arc(&lt;Surface&gt;, color, &lt;Rect&gt;, start_angle, stop_angle)
pg.draw.line(&lt;Surface&gt;, color, start_pos, end_pos, width)
pg.draw.lines(&lt;Surface&gt;, color, points)
</code></pre>
<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>)
&lt;Font&gt; = pg.font.Font(<span class="hljs-string">'&lt;path&gt;'</span>, size)

Loading…
Cancel
Save