(example.py) File created

This commit is contained in:
KikooDX 2020-04-09 18:13:04 +02:00
parent 3ef2a4577f
commit f41d6bb90e
1 changed files with 28 additions and 0 deletions

28
example.py Normal file
View File

@ -0,0 +1,28 @@
#import the module
from sprito import *
from casioplot import show_screen
#create pallet
pallet = {
"a": (255,0,0),
"b": (0,255,0)
}
#create indexed sprite
sprite = SpriteIndexed(4, 4, "\
aaaa\
baba\
abab\
bbbb")
#create raw sprite from sprite
raw_sprite = sprite.to_raw(pallet)
#draw indexed sprite
sprite.draw(0, 0, pallet)
#draw raw sprite
raw_sprite.draw(16, 0)
#display
show_screen