|
|
@ -2493,9 +2493,9 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2 |
|
|
|
</code></pre></div></div> |
|
|
|
|
|
|
|
|
|
|
|
<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) |
|
|
|
<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(x, y, width, height) |
|
|
|
<int> = <Rect>.x/y/centerx/centery |
|
|
|
<tup.> = <Rect>.topleft/topright/bottomright/bottomleft/center |
|
|
|
<tup.> = <Rect>.topleft/center |
|
|
|
<Rect> = <Rect>.move((x, y)) |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
@ -2507,7 +2507,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2 |
|
|
|
</code></pre> |
|
|
|
<div><h3 id="surface">Surface</h3><p><strong>Object for representing images.</strong></p><pre><code class="python language-python hljs"><Surf> = pg.display.set_mode((width, height)) <span class="hljs-comment"># Returns the display surface.</span> |
|
|
|
<Surf> = pg.Surface((width, height)) <span class="hljs-comment"># Creates a new surface.</span> |
|
|
|
<Surf> = pg.image.load(<span class="hljs-string">'<path>'</span>).convert() <span class="hljs-comment"># Loads an image.</span> |
|
|
|
<Surf> = pg.image.load(<span class="hljs-string">'<path>'</span>) <span class="hljs-comment"># Loads the image.</span> |
|
|
|
<Surf> = <Surf>.subsurface(<Rect>) <span class="hljs-comment"># Returns a subsurface.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|