Blog/PNGToArray

5 posts

Flag Post

I wrote a post here: http://recursivedev.wordpress.com/2012/11/23/56/

Could you guys go ahead and try it out and maybe suggest a few things to fix/add before I go publish it out on /r/gamedev? Corrections/additions to the post are appreciated also.

Thanks.

 
Flag Post

I think that it’s sort of pointless to output an array to copy and paste into a sourcefile. What I would do is load the image at runtime; or if you want to conserve space; have your application output a more condensed format. Most developers won’t need an Array; instead they’ll load a json/plain text file and parse the simpler information from there.

because you are generating an array, it seems that the application is very Flash specific. Maybe you can add for custom output to json or xml?

 
Flag Post
Originally posted by qwerber:

I think that it’s sort of pointless to output an array to copy and paste into a sourcefile. What I would do is load the image at runtime; or if you want to conserve space; have your application output a more condensed format. Most developers won’t need an Array; instead they’ll load a json/plain text file and parse the simpler information from there.

because you are generating an array, it seems that the application is very Flash specific. Maybe you can add for custom output to json or xml?

How would I do that? Seems a little pointless to have an individual xml line for each and every tile.

Also, this was more designed so that you don’t need a level editor. In json/xml you would either need to design a level editor that outputs to json/xml or just write it from scratch. +It’s not necessarily an “Array” but something you could throw in a text-file and load. Maybe I’ll name it PNGToLevel, it makes a little more sense then.

 
Flag Post

Originally posted by qwerber:

…into a sourcefile….condensed format. Most developers won’t need an Array; instead they’ll load a json/plain text file and parse the simpler information from there.

because you are generating an array, it seems that the application is very Flash specific. Maybe you can add for custom output to json or xml?

that is valid JSON in either 1d or 2d array form. AS/JS are virtually identical, and JSON uses the same syntax for array/object/string/number; there is no way to compress that further without using a compression algorithm such as LZMA and Base64 encode that output

 
Flag Post

Aha, I was mentioning compressions and json separately. And by json I mean with other information + those sexy curly braces