Author Topic: Hex with Sprites  (Read 6958 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Hex with Sprites
« on: May 02, 2010, 05:57:23 pm »
Hello All,

Could someone please explain how hex works with creating sprites and all that? All I really know is that [FFFFFFFFFFFFFFFF] creates a solid 8*8 block while [0000000000000000] leaves a blank 8*8 area. Any help is very appreciated :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Hex with Sprites
« Reply #1 on: May 02, 2010, 06:13:01 pm »
Well, do you know how hex is just a representation of binary? 0=0000,1=0001, and so on, with C=1100, E=1110, and all the other hex digits.
You basically just draw your 8*8 sprite, and then for each row make two hex digits, one for each four bits in the row. For example, 11001001 is C9. Do this and you will have 8 pairs of digits, for 16 total. Reading these left to right, top to bottom gives the hex code for the sprite.
For the reverse, put the 16 digits into 8 rows, two digits in each row. Replace each digit with the binary that corresponds to it, and you'll have an 8*8 sprite.
Maybe I forgot to mention this, but black pixels are 1's and white pixels 0's.
Hope this helps!
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #2 on: May 02, 2010, 06:17:04 pm »
0=00000000
1=00000001
2=00000010
3=00000011
4=00000100
5=00000101
6=00000110
7=00000111
8=00001000
9=00001001
A=00001010
B=00001011
C=00001100
D=00001101
E=00001110
F=00001111

10=00010000
20=00100000
30=00110000
40=01000000
50=01010000
60=01100000
70=01110000
80=10000000
90=10010000
A0=10100000
B0=10110000
C0=11000000
D0=11010000
E0=11100000
F0=11110000


A 8x8 binary sprite is made of 8 binary strings of 8 numbers. 1=black and 0=white. If for example, the first row of your sprite is 11011011, separate it like this:

1101 1011
First, using the chart above, would be D, while the second would be B, in hex. Combined together gives DB. If you got a 8x8 sprite, repeat the process with all 8 rows of pixels.

Alternatively there are some pic to hex or bin to hex converters in the Axe parser forum and on ticalc.org, which speeds up the process in some cases, but I think the method above is the fastest to convert them manually.
« Last Edit: May 02, 2010, 06:27:47 pm by DJ Omnimaga »

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: Hex with Sprites
« Reply #3 on: May 02, 2010, 06:22:36 pm »
let's not forget http://www.ticalc.org/archives/files/fileinfo/389/38904.html

It was made specifically for this function, converting a sprite into hex code. ^ ^
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #4 on: May 02, 2010, 06:25:47 pm »
Oh forgot about that one, thanks for reminding me ^^

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Hex with Sprites
« Reply #5 on: May 02, 2010, 08:15:29 pm »
Thanks guys :) I'm not really looking for a "Sprite-to-Hex" converter (besides to look for examples of how) because I just needed to kinda understand the basics so I can hopefully implement it into a program I plan to work on soon.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Hex with Sprites
« Reply #6 on: May 02, 2010, 08:23:47 pm »
CalcGS is also highly recommended. It supports sprites & tilemaps plus 4-level grayscale and will export data that you can use with your assembler.

http://www.ticalc.org/archives/files/fileinfo/132/13274.html
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #7 on: May 02, 2010, 08:31:58 pm »
Doesn't calcgs import sprite data in a rather strange way, though?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Hex with Sprites
« Reply #8 on: May 02, 2010, 09:09:26 pm »
I use this one.  Its really basic, but its great for monochrome images and supports any size you want.

http://www.ticalc.org/archives/files/fileinfo/134/13415.html
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #9 on: May 02, 2010, 09:15:53 pm »
that one gave me an hard time, though x.x

When I tried to run it I ended up with full of missing .OCX/.DLL errors and had to go search them online to get it to work x.x
 
To anyone wanting to use this program, watch out for viruses if you download OCX files because some sites aren't very legit x.x
« Last Edit: May 02, 2010, 09:17:15 pm by DJ Omnimaga »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Hex with Sprites
« Reply #10 on: May 02, 2010, 09:28:39 pm »
Isn't that the one in the downloads section? Or is that a different one?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #11 on: May 02, 2010, 10:31:18 pm »
It's in the downloads sections. I still need to add a few alternatives, though.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Hex with Sprites
« Reply #12 on: May 03, 2010, 01:01:50 am »
With CalcGS you can import from the clipboard or from BMP's. The only thing you have to remember is to set the size.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hex with Sprites
« Reply #13 on: May 03, 2010, 01:06:27 am »
can it import tiles from a BMP tilesheet? I mean, will it separate them in 8x8 tiles if you tell it to do so?

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Hex with Sprites
« Reply #14 on: May 03, 2010, 02:02:43 am »
It certainly will.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."