Omnimaga

General Discussion => Art => Topic started by: apcalc on July 30, 2010, 02:08:03 pm

Title: Sprite to Code Converter
Post by: apcalc on July 30, 2010, 02:08:03 pm
Hi.  I am not sure if this is the correct forum for this, feel free to move this if it is not.  In my Nspire programs, I am finding it to be a very time consuming job transferring from sprite drawings to code.  I have some sprites drawn that are 24 by 24 pixels, but I dread the thought to converting these pics into code by typing in the individual color number in my declaration.  (For example, a 4 by 4 sprite that is black in the first row and white in the second row would be declared as char sprite[4]={0,0,15,15}; ).  24 by 24 sprites would have 576 members in the declaration array and I dread having to do all of that work for five different sprites.  I was wondering if there is a program available that will convert my sprites to code, or if not, how would I go about writing a program to do so?  Thank you for your help!!
Title: Re: Sprite to Code Converter
Post by: fb39ca4 on July 30, 2010, 02:15:33 pm
I haven't heard of anything that does that. It would be nice to have two pixels in each element, so the sprites take up half the memory. BTW, I think you meant a 2x2 sprite up there.

EDIT:


There is one! It's called spriteric.

http://sourceforge.net/projects/spriteric/ (http://sourceforge.net/projects/spriteric/)
Title: Re: Sprite to Code Converter
Post by: bwang on July 30, 2010, 03:32:31 pm
apcalc: I posted a bmp to C converter in your Block Dude thread, since I didn't see this thread.
I think it is exactly what you wanted (it generated all of Ncaster's textures).
I would dread converting 576 pixels worth of data into an array too :P
Title: Re: Sprite to Code Converter
Post by: apcalc on July 30, 2010, 03:53:47 pm
Thank you so much bwang!!

That makes my life a lot easier not having to convert sprites anymore!!!!