Sprite : program in JAVA for translate a image in code for LUA,

I’ve make a program in JAVA for translate a image in code for LUA,

I work on ubuntu, in shell, this is a example command

$ ls | grep “Stance”

Stance1 (copy).PNG
Stance1.PNG

$ ls | grep “GPC”

GPC.class
GPC.java

$ java GPC P1S1 Stance1.PNG P1S1

(P1S1 = name of fichier with line code LUA,
Stance1.PNG = name + extension of image
P1S1 = name of image in LUA )

$ cat P1S1

(result is on http://spritesystem.posterous.com/ )

example
this is a part of code for LUA, image name is P1S1 :

P1S1 = image(69, 67)
P1S1:set(1, 67 , color(0, 128, 0, 255) )
P1S1:set(1, 66 , color(0, 128, 0, 255) )
P1S1:set(1, 65 , color(0, 128, 0, 255) )
P1S1:set(1, 64 , color(0, 128, 0, 255) )
P1S1:set(1, 63 , color(0, 128, 0, 255) )
P1S1:set(1, 62 , color(0, 128, 0, 255) )
P1S1:set(1, 61 , color(0, 128, 0, 255) )
P1S1:set(1, 60 , color(0, 128, 0, 255) )
P1S1:set(1, 59 , color(0, 128, 0, 255) )
P1S1:set(1, 58 , color(0, 128, 0, 255) )
P1S1:set(1, 57 , color(0, 128, 0, 255) )
P1S1:set(1, 56 , color(0, 128, 0, 255) )
P1S1:set(1, 55 , color(0, 128, 0, 255) )
P1S1:set(1, 54 , color(0, 128, 0, 255) )
P1S1:set(1, 53 , color(0, 128, 0, 255) )
...

Look just like what I was looking for. Where’s the code of how to do it? Now I’m getting excited.
Thanks!

http://spritesystem.posterous.com/

Sorry. I had just found it. It’s not on the mobile version of the site.

Sorry. I’m not so good at some computer things like Java. Where to you put the code?
Thanks! This look great!

you are on Windows , MAC or Linus (Ubuntu, Slack, …) ?

So, can you answer me? Sorry. (Have I said sorry too many times?)

Because if you are on Windows or MAC, it get a another version of program

I have an Ubuntu Parallels box. I can run it. Sorry for my ridiculous questions.

I’m running Mac OS X and I also have a Chrome Parallels.

with ubuntu

ok, put code in file with name : “GPC.java”
open terminal, install java pack (if you don’t have)

$sudo apt-get update

$sudo apt-get install ecj
(press y for yes x] )

create a directory with a image.png (for try : 32x32 pixel )
and with GPC.java

open your directory with shell,

compil

$javac GPC.java

and try

$java GPC text (nameOfImage).png (name of image for LUA)

after that, in your directory a file is appear : “text”
open and …

(I edited your first posts to put stuff in code, but now I think I’ll do the “Teach a man to type in Markdown, …” bit: Inline code should be in backticks:

`like this`

Block code needs to be “fenced” or indented 4 spaces; “fences” are lines with just ~~~ on them, so:


~~~
some code
~~~

gets rendered as:

some code

There’s a minor bug that inserts a space on the first line)

thanks :smiley:

I send a real tutorial next time for all OS