|
2496 | 2496 | <div><h3 id="rect">Rect</h3><p><strong>Object for storing rectangular coordinates.</strong></p><pre><code class="python language-python hljs"><Rect> = pg.Rect(topleft_x, topleft_y, width, height) |
2497 | 2497 | <tuple> = <Rect>.topleft/topright/bottomright/bottomleft/center |
2498 | 2498 | <int> = <Rect>.x/y/centerx/centery |
| 2499 | +<Rect> = <Rect>.move(<tuple>) <span class="hljs-comment"># Or: <Rect>.move(<int>, <int>)</span> |
2499 | 2500 | </code></pre></div> |
2500 | 2501 |
|
2501 | 2502 |
|
2502 | | -<pre><code class="python language-python hljs"><Rect> = <Rect>.move(<tuple>) <span class="hljs-comment"># Or: <Rect>.move(<int>, <int>)</span> |
2503 | | -<Rect>.move_ip(<tuple>) <span class="hljs-comment"># Or: <Rect>.move_ip(<int>, <int>)</span> |
2504 | | -</code></pre> |
2505 | 2503 | <pre><code class="python language-python hljs"><bool> = <Rect>.collidepoint(<tuple>) <span class="hljs-comment"># Or: <Rect>.collidepoint(<int>, <int>)</span> |
2506 | 2504 | <bool> = <Rect>.colliderect(<Rect>) |
2507 | 2505 | index = <Rect>.collidelist(<list_of_Rect>) <span class="hljs-comment"># Returns index of first coliding Rect or -1.</span> |
|
2522 | 2520 | <Surface> = pg.transform.rotate(<Surface>, angle) |
2523 | 2521 | <Surface> = pg.transform.scale(<Surface>, (width, height)) |
2524 | 2522 | </code></pre> |
2525 | | -<pre><code class="python language-python hljs">pg.draw.rect(<Surface>, color, <Rect>) |
| 2523 | +<pre><code class="python language-python hljs">pg.draw.line(<Surface>, color, start_pos, end_pos, width) |
| 2524 | +pg.draw.arc(<Surface>, color, <Rect>, start_angle, stop_angle) |
| 2525 | +pg.draw.rect(<Surface>, color, <Rect>) |
2526 | 2526 | pg.draw.polygon(<Surface>, color, points) |
2527 | | -pg.draw.circle(<Surface>, color, center, radius) |
2528 | 2527 | pg.draw.ellipse(<Surface>, color, <Rect>) |
2529 | | -pg.draw.arc(<Surface>, color, <Rect>, start_angle, stop_angle) |
2530 | | -pg.draw.line(<Surface>, color, start_pos, end_pos, width) |
2531 | | -pg.draw.lines(<Surface>, color, points) |
2532 | 2528 | </code></pre> |
2533 | 2529 | <div><h3 id="font">Font</h3><pre><code class="python language-python hljs"><Font> = pg.font.SysFont(name, size, bold=<span class="hljs-keyword">False</span>, italic=<span class="hljs-keyword">False</span>) |
2534 | 2530 | <Font> = pg.font.Font(<span class="hljs-string">'<path>'</span>, size) |
|
0 commit comments