Alternatively, join us on Discord.
You can help CodeWalrus stay online by donating here.

Graphics and other system routines

Started by DarkestEx, October 19, 2015, 10:31:05 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.


November 24, 2015, 08:30:05 AM #60 Last Edit: November 24, 2015, 12:19:15 PM by DarkestEx
Quote from: DJ Omnimaga on November 24, 2015, 07:55:27 AM
So I am curious about what the following sprites would look like in Microcat format and how much space they would take:

Would the sprite sheet need to be split into multiple files and only one part loaded at a time?
Sure, I'll convert it for you.
About the size and if you have to split it, you can calculate that easily.
But first, what pixel format do you want to use? In this case I would either use 4bpp or preferably 8bpp.
To calculate the size of an image in bytes, simply do:
size = 20 + (2^bpp) - 1 + (width * height * bpp) / 8

(Only do the + (2^bpp) - 1 if you are using a bpp < 8 )

The maximum size of a sprite(sheet) is 32KB.

Edit: But to answer your question, no, you cannot load a sprite(sheet) this big at once. 32 KB max per sprite(sheet). I will in the future just refer to sprite as for the console / claw, a spritesheet and a single sprite are exactly the same thing.
There will be a draw sprite rectangle method to draw only a part of a sprite or spritesheet.

DJ Omnimaga

Thanks for the info. Not bad I guess, since I can split the spritesheet in rows :)

Powered by EzPortal