(example.py) Added demo of fill_screen, rect & invert_rect

This commit is contained in:
KikooDX 2020-04-12 18:33:37 +02:00
parent 67feca86b6
commit 85b5d24449
1 changed files with 9 additions and 6 deletions

View File

@ -1,17 +1,20 @@
#import the module
from sprito import *
#fill screen with black
fill_screen(C_BLACK)
#refresh
show_screen()
#draw yellow rectangle
rect(0, 0, 64, 64, C_YELLOW)
show_screen()
#create indexed sprite
sprite = SpriteIndexed(8, 8, [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]*8)
#create raw sprite from sprite
raw_sprite = sprite.to_raw(PALLET_BYTE)
#draw indexed sprite
sprite.draw(0, 0, PALLET_BYTE)
#draw raw sprite
raw_sprite.draw(16, 0)
#display
#invert raw sprite
invert_rect(16, 0, 8, 8)
show_screen()