kopia lustrzana https://github.com/pimoroni/pimoroni-pico
updated PicoGraphics README and .gitignore
rodzic
f101ffdb4d
commit
952cb4e825
|
@ -33,3 +33,7 @@
|
||||||
|
|
||||||
**/build
|
**/build
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
# Apple filesystem cruft
|
||||||
|
.DS_Store
|
||||||
|
venv
|
|
@ -78,7 +78,7 @@ All SPI LCDs support 0, 90, 180 and 270 degree rotations.
|
||||||
Eg:
|
Eg:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
display = PicoGraphics(display=PICO_DISPLAY, roation=90)
|
display = PicoGraphics(display=PICO_DISPLAY, rotate=90)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Pins
|
### Custom Pins
|
||||||
|
@ -362,12 +362,25 @@ We've prepared some RGB332-compatible sprite assets for you, but you can use `sp
|
||||||
|
|
||||||
#### Loading Sprites
|
#### Loading Sprites
|
||||||
|
|
||||||
|
You'll need to include the [pen_type](#supported-graphics-modes-pen-type) in the import statement, and define the pen_type before using loading the spritesheet:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from picographics import PicoGraphics, PEN_RGB565, PEN_RGB332
|
||||||
|
|
||||||
|
display = PicoGraphics(display=PICO_DISPLAY, pen_type=PEN_RGB332)
|
||||||
|
```
|
||||||
Use Thonny to upload your `spritesheet.rgb332` file onto your Pico. Then load it into Pico Graphics:
|
Use Thonny to upload your `spritesheet.rgb332` file onto your Pico. Then load it into Pico Graphics:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
display.load_spritesheet("s4m_ur4i-dingbads.rgb332")
|
display.load_spritesheet("s4m_ur4i-dingbads.rgb332")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
and then update the display, to show the sprite:
|
||||||
|
|
||||||
|
```python
|
||||||
|
display.update()
|
||||||
|
```
|
||||||
|
|
||||||
#### Drawing Sprites
|
#### Drawing Sprites
|
||||||
|
|
||||||
And finally display a sprite:
|
And finally display a sprite:
|
||||||
|
|
Ładowanie…
Reference in New Issue