I am trying to use mygame.display.drawBitmap. It works fine when drawing a single image, but when I attempt to draw 2 different images with different palettes, it used the last set palette to draw all bitmaps.
while (mygame.isRunning())
{
if (mygame.update())
{
mygame.display.load565Palette(tile_top_pal);
mygame.display.drawBitmap(8,8,tile_top);
mygame.display.load565Palette(tile_body_pal);
mygame.display.drawBitmap(8,16,tile_body);
}
}
In this simple example it will use ātile_body_palā when drawing ātile_topā even though a different palette (ātile_top_palā) was set at the time that tile_top was drawn.
Is this the expected behavior? Am I using this wrong? How can I draw multiple images with different palettes? Or is the expectation that I would have a single palette for the entire game?
Hereās the graphics data:
const uint16_t tile_top_pal[] = {
0,1066,64768,43654
};
const uint8_t tile_top[] = {
8,8,
85,85,85,85,85,85,213,103,
245,175,234,191,170,255,171,254,
};
const uint16_t tile_body_pal[] = {
0,64768,43654,43654
};
const uint8_t tile_body[] = {
8,8,
90,165,106,149,170,85,169,86,
165,90,149,106,85,170,86,169,
};