Skip to content

Commit

Permalink
Merge pull request #81 from ThePythonator/main
Browse files Browse the repository at this point in the history
Updated micropython README to add info about sprite and text functions, along with a typo fix.
  • Loading branch information
Gadgetoid authored Jul 28, 2022
2 parents c098a4b + d7f5f24 commit 75784fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion micropython/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ If you find things not working as expected on the REPL, reset your pen, cursor,
* `vline(x, y, length)` - vertical line starting from xy, length in pixels
* `poly((x, y), (x, y), (x, y))` - polygon (supply points as tuples)
* `fpoly((x, y), (x, y), (x, y))` - filled polygon (supply points as tuples)
* `text(message)` - message at cursor position
* `text(message, wrap)` - message at cursor position, text will be wrapped on word boundaries if it exceeds wrap width in pixels
* `text(message, x, y)` - message at xy
* `text(message, x, y, wrap)` - message at xy, text will be wrapped on word boundaries if it exceeds wrap width in pixels
* `sprite(i, x, y)` - draws sprite from current spritesheet at xy
* `sprite(i, x, y, cx, cy)` - draws a rectangle of sprites from current spritesheet at xy, cx sprites across and cy sprites down
* `sprite(i, x, y, cx, cy, dw, dh)` - draws a rectangle of sprites from current spritesheet at xy, cx sprites across and cy sprites down, scaled to a rectangle dw by dh pixels
* `sprite(i, x, y, cx, cy, dw, dh, flags)` - draws a rectangle of sprites from current spritesheet at xy, cx sprites across and cy sprites down, scaled to a rectangle dw by dh pixels, flags can be any combination of HFLIP and VFLIP
* `blit(Buffer, x, y, w, h, dx, dy)` - blit a portion of a Buffer to dx,dy
* `blit(Buffer, x, y, w, h, dx, dy, dw, dh)` - blit a portion of a Buffer to dx,dy stretching to dw,dh

Expand All @@ -111,7 +119,7 @@ If you find things not working as expected on the REPL, reset your pen, cursor,

### Buffers

A Buffer contains an image or spriteshet in the screen pixel format (16bit AAAARRRRGGGGBBBB).
A Buffer contains an image or spritesheet in the screen pixel format (16bit AAAARRRRGGGGBBBB).

You can draw to a Buffer using all the regular drawing operations, or draw a Buffer to the screen with `blit()`.

Expand Down

0 comments on commit 75784fb

Please sign in to comment.