Author Topic: Sprite to Code Converter  (Read 5794 times)

0 Members and 1 Guest are viewing this topic.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Sprite to Code Converter
« 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!!


Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Sprite to Code Converter
« Reply #1 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/
« Last Edit: July 30, 2010, 03:16:56 pm by fb39ca4 »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Sprite to Code Converter
« Reply #2 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

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Sprite to Code Converter
« Reply #3 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!!!!