Exported file from Piskel issue


#1

Is there anyone else having a hard time doing a simple thing like displaying a full screen image exported from Piskel (pokitto version)?

I imported an image with 5 colours in Piskel. Set the colours to HEX and 16 made sure the palette is made of the image colours.

The I export the .h file and the image displayed on the pokitto is showing only black and white.

I really just did like in the tutorial that was teaching hot to display the pokitto icon…

I can’t believe that I am struggling with something so basic… :sweat_smile:


#2

Did you notice that you need to create a palette that stores your colours?

Section 2.3.2 in the guide

This is a hardcoded limitation of Piskel that would require lots of rework. The problem is that palette[0] (aka Current colors) only saves colors that are in active graphic.


#3

Yes. I went to add palette and then loaded the palette from the image itself. Still it’s not displaying any colours on the pokitto. I know i am probably missing a small detail somewhere…


#4

Could you maybe post your code?
(small chance that I will solve your problem but maybe someone else will be able to help you :slight_smile:)


#5

Thank you @Jonne looks like I had to actually input a name manually for the palette to be saved… Weird.

Anyway the important thing is that it is displaying the title screen now. :wink:

@sbmrgd I knew my code was ok, just wasn’t sure how the colours were handled in Piskel for the export. But thank you for offering help.


#6

When coding a game. Should I use only 1 palette? What I mean is that since I am loading the palette at the start of my main.cpp file. Should I have all the colours used in the whole game in that file or I need to load a palette for each sprites that the game is using.

Sorry for the newbie question but i never had to code a game in colour before( I am used to 1bit gfx)


#7

You can only have one at a time.*

You can change the palette as much as you like though.
(I.e. you could have one palette for the main screen and one for the game itself, and yet another for a settings menu.)

* This is a bit of a lie, the sprite modes** support using different palettes for the sprites

** The ‘sprite’ modes emulate actual hardware sprites. Originally the term sprites referred specifically to hardware sprites, where the background was made from tiles and there were a limited number of sprites that could be drawn anywhere on the screen (sometimes there was a limit to the number of sprites/palettes per scanline).


#8

So basically it’s 1colour palette per screen at once.

So I should declare a full 16 colours palette and then the sprites used per screen should use anything included in that palette right?


#9

It depends on which screen mode you are using


#10

Drawing images the normal way (through calls to drawBitmap) uses the global colour palette,
so whatever colours you’ve loaded the palette with are the colours that the bitmaps will use.

Like I say, certain modes suport ‘proper sprites’ which can use different palettes,
but you probably won’t be needing to use those for now, you can look into them later.


#11

If you want to make life simple for yourself then the answer is yes