Browse Source

Pygame

pull/52/head
Jure Šorn 5 years ago
parent
commit
d360676351
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -2951,13 +2951,13 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
<Surf> = pg.display.set_mode((width, height)) # Returns the display surface.
<Surf> = pg.Surface((width, height)) # Creates a new surface.
<Surf> = pg.image.load('<path>').convert() # Loads an image.
<Surf> = <Surf>.subsurface(<Rect>) # Returns a subsurface.
```
```python
<Surf>.set_at((x, y), color) # Updates pixel.
<Surf>.fill(color) # Fills the whole surface.
<Surf>.blit(<Surface>, (x, y)) # Draws passed surface to the surface.
<Surf> = <Surf>.subsurface(<Rect>) # Returns subsurface.
```
```python

2
index.html

@ -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">&lt;Surf&gt; = pg.display.set_mode((width, height)) <span class="hljs-comment"># Returns the display surface.</span>
&lt;Surf&gt; = pg.Surface((width, height)) <span class="hljs-comment"># Creates a new surface.</span>
&lt;Surf&gt; = pg.image.load(<span class="hljs-string">'&lt;path&gt;'</span>).convert() <span class="hljs-comment"># Loads an image.</span>
&lt;Surf&gt; = &lt;Surf&gt;.subsurface(&lt;Rect&gt;) <span class="hljs-comment"># Returns a subsurface.</span>
</code></pre></div>
<pre><code class="python language-python hljs">&lt;Surf&gt;.set_at((x, y), color) <span class="hljs-comment"># Updates pixel.</span>
&lt;Surf&gt;.fill(color) <span class="hljs-comment"># Fills the whole surface.</span>
&lt;Surf&gt;.blit(&lt;Surface&gt;, (x, y)) <span class="hljs-comment"># Draws passed surface to the surface.</span>
&lt;Surf&gt; = &lt;Surf&gt;.subsurface(&lt;Rect&gt;) <span class="hljs-comment"># Returns subsurface.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;Surf&gt; = pg.transform.flip(&lt;Surf&gt;, xbool, ybool)
&lt;Surf&gt; = pg.transform.rotate(&lt;Surf&gt;, degrees)

Loading…
Cancel
Save