|
|
@ -2508,13 +2508,13 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2 |
|
|
|
<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> = <Surf>.subsurface(<Rect>) <span class="hljs-comment"># Returns a subsurface.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
|
|
|
|
<pre><code class="python language-python hljs"><Surf>.set_at((x, y), color) <span class="hljs-comment"># Updates pixel.</span> |
|
|
|
<Surf>.fill(color) <span class="hljs-comment"># Fills the whole surface.</span> |
|
|
|
<Surf>.blit(<Surface>, (x, y)) <span class="hljs-comment"># Draws passed surface to the surface.</span> |
|
|
|
<Surf> = <Surf>.subsurface(<Rect>) <span class="hljs-comment"># Returns subsurface.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><Surf> = pg.transform.flip(<Surf>, xbool, ybool) |
|
|
|
<Surf> = pg.transform.rotate(<Surf>, degrees) |
|
|
|