Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

edited January 2012 in General Posts: 304

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/ )

Comments

  • edited January 2012 Posts: 304

    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) )
    ...
    
  • Posts: 2,820

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

  • Posts: 2,820

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

  • Posts: 2,820

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

  • edited January 2012 Posts: 304

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

  • Posts: 2,820

    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

  • Posts: 2,820

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

  • Posts: 2,820

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

  • edited January 2012 Posts: 304

    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 ...

  • Posts: 2,161

    (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 :-D

  • I send a real tutorial next time for all OS

Sign In or Register to comment.