Hexadecimal Sprite Data
-
I was pleased to find that this seems to work as a replacement for the playerShip sprite image data in the Invader example (despite no obvious mention of hexadecimal notation in the documentation?). It's not that exciting in this case, but could presumably be expanded for larger sprites with different bit depths (4-colour, 16-colour, etc.) Then if there was a PC conversion tool that would transform graphics files on your PC into data which could be typed into FUZE then that might have some value? If I'm missing something then let me know (classic refusal to properly read the manual - sorry).
I'm also wondering why some binary functions appear to be in 64-bit and others 32-bit? Doesn't matter really as 16-bit WORDs are probably easier for people to type in anyway, but there was something appealing about storing an entire sprite in one number :-)
array playerShip [64] data = [ 0x99181800, 0xFFFFBD99 ] for bit=0 to 64 loop v = bitGet( data[floor(bit/32)], bit%32 ) playerShip[bit] = { v,v,v,v } repeat
-
This is actually really useful for me because I've been inputting hex data as 0xXX, 0xXX etc. Thanks!
-
@jacobmph said in Hexadecimal Sprite Data:
Then if there was a PC conversion tool that would transform graphics files on your PC into data which could be typed into FUZE then that might have some value?
I made such a tool yesterday (where you can type in XPM files):
https://fuzearena.com/forum/topic/197/xpm-graphics-converter-transferring-graphics-from-computers-and-other-sourcesThanks for the tip on the hexadecimal syntax!
-
@Nisse5 Nice! What's it written in? Are you prepared to share your repo?
-
@MikeDX Although I guess you're less likely to get confused about the byte order your way :-)
-
that's true but i am happy to decode in the right order regardless. i had already considered using a string and converting string hex to bytes...
-
@jacobmph said in Hexadecimal Sprite Data:
@Nisse5 Nice! What's it written in? Are you prepared to share your repo?
It's in FUZE4Switch. The code is shared on my Switch account.
Use any XPM converter on the PC to convert the graphics to XPM files there (XPM is text files).
-
Oh I see. Okay I’ll look at knocking up a quick command line tool to output the data in hex when I get a moment. Perhaps some kind of RLE compression might help for larger images. Thanks. Will take a look at your Switch code too.