sprito/README.md

33 lines
965 B
Markdown
Raw Permalink Normal View History

2020-04-12 18:48:22 +02:00
# Sprito
CG-50 Python drawing framework
2020-04-09 18:06:41 +02:00
2020-04-12 18:48:22 +02:00
## Drawing functions
`rect(x: int, y: int, w: int, h: int, color: tuple) -> None` :
Draw a rectangle with the given **color** from (**x**;**y**) of size **w**
(width) times **h** (height).
`fill_screen(color: tuple) -> None` :
Fill the screen with the given **color**.
`invert_pixel(x: int, y: int) -> None` :
Invert the pixel color at (**x**;**y**).
`invert_rect(x: int, y: int, w: int, h: int) -> None` :
Invert all the pixels of the rectangle from (**x**;**y**) of size **w** (width)
times **h** (height).
`store_rect(x: int, y: int, w:int, h: int) -> SpriteRaw` :
Store all the pixels of the given area in a `SpriteRaw`.
2020-04-12 19:05:47 +02:00
## Constants
`C_BLACK`, `C_WHITE`, `C_RED`, `C_GREEN`, `C_BLUE`, `C_YELLOW`, `C_PURPLE`,
`C_CYAN`.
`PALLET_STR`, `PALLET_BYTE`.
2020-04-12 18:48:22 +02:00
## Sprite classes (WIP)
`SpriteIndexed` : indexed sprite. Draw using pallets.
`SpriteRaw` : raw sprite, usually heavier than an indexed sprite but faster to
draw.