(example.py) Updated code, use byte array.

This commit is contained in:
KikooDX 2020-04-12 18:26:35 +02:00
parent fef264bf75
commit d95cc280d2
1 changed files with 3 additions and 14 deletions

View File

@ -1,25 +1,14 @@
#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")
sprite = SpriteIndexed(4, 4, [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]*2)
#create raw sprite from sprite
raw_sprite = sprite.to_raw(pallet)
raw_sprite = sprite.to_raw(PALLET_BYTE)
#draw indexed sprite
sprite.draw(0, 0, pallet)
sprite.draw(0, 0, PALLET_BYTE)
#draw raw sprite
raw_sprite.draw(16, 0)