Skip to content

Commit

Permalink
Linux application export
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfalon committed Aug 3, 2015
1 parent 0ccc9eb commit c5d8862
Show file tree
Hide file tree
Showing 19 changed files with 336 additions and 0 deletions.
4 changes: 4 additions & 0 deletions application.linux32/SpriteSheetGenerator
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

APPDIR=$(dirname "$0")
java -Djna.nosys=true -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR/lib/SpriteSheetGenerator.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-i586.jar:$APPDIR/lib/gluegen-rt-natives-linux-i586.jar" SpriteSheetGenerator "$@"
Binary file added application.linux32/lib/SpriteSheetGenerator.jar
Binary file not shown.
Binary file added application.linux32/lib/core.jar
Binary file not shown.
Binary file not shown.
Binary file added application.linux32/lib/gluegen-rt.jar
Binary file not shown.
Binary file not shown.
Binary file added application.linux32/lib/jogl-all.jar
Binary file not shown.
96 changes: 96 additions & 0 deletions application.linux32/source/SpriteSheetGenerator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;

import javax.swing.JOptionPane;
import java.io.File;

import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class SpriteSheetGenerator extends PApplet {




PImage[] images;
boolean draw;
PImage background;
int imageHeight;

public void setup()
{
background = new PImage();
String number = JOptionPane.showInputDialog("How many Pictures are there?");
int imageNumber = Integer.parseInt(number);
images = new PImage[imageNumber];
println(imageNumber);
String h = JOptionPane.showInputDialog("How tall is each picture?");
imageHeight = Integer.parseInt(h);
selectFolder("Please Select The Folder: ", "folderSelectCallback");
frame.setResizable(true);
size(imageHeight, imageHeight);
background(255);
frameRate(60);
draw = false;
}

int i = 0;
int x = 0;
public void draw()
{
if(draw)
{
i++;
if(i == images.length)
{
exit();
}
int x = 0;
for(int j = 0; j < i; j++)
{
PImage image = images[j];
image(image, x, 0, image.width, imageHeight);
x += image.width;
}

println(x);
frame.setSize(x, imageHeight);
saveFrame("file.png");
}
}

public void folderSelectCallback(File folder)
{
if (folder == null) {
println("Window was closed or the user hit cancel.");
exit();
} else {
String path = folder.getAbsolutePath();
println("User selected " + path);

for(int i = 0; i < images.length; i++)
{
images[i] = loadImage(path+File.separator+String.format("%04d", i+1)+".png");
}

draw = true;

}
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "SpriteSheetGenerator" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
68 changes: 68 additions & 0 deletions application.linux32/source/SpriteSheetGenerator.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import javax.swing.JOptionPane;
import java.io.File;

PImage[] images;
boolean draw;
PImage background;
int imageHeight;

void setup()
{
background = new PImage();
String number = JOptionPane.showInputDialog("How many Pictures are there?");
int imageNumber = Integer.parseInt(number);
images = new PImage[imageNumber];
println(imageNumber);
String h = JOptionPane.showInputDialog("How tall is each picture?");
imageHeight = Integer.parseInt(h);
selectFolder("Please Select The Folder: ", "folderSelectCallback");
frame.setResizable(true);
size(imageHeight, imageHeight);
background(255);
frameRate(60);
draw = false;
}

int i = 0;
int x = 0;
void draw()
{
if(draw)
{
i++;
if(i == images.length)
{
exit();
}
int x = 0;
for(int j = 0; j < i; j++)
{
PImage image = images[j];
image(image, x, 0, image.width, imageHeight);
x += image.width;
}

println(x);
frame.setSize(x, imageHeight);
saveFrame("file.png");
}
}

void folderSelectCallback(File folder)
{
if (folder == null) {
println("Window was closed or the user hit cancel.");
exit();
} else {
String path = folder.getAbsolutePath();
println("User selected " + path);

for(int i = 0; i < images.length; i++)
{
images[i] = loadImage(path+File.separator+String.format("%04d", i+1)+".png");
}

draw = true;

}
}
4 changes: 4 additions & 0 deletions application.linux64/SpriteSheetGenerator
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

APPDIR=$(dirname "$0")
java -Djna.nosys=true -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR/lib/SpriteSheetGenerator.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar" SpriteSheetGenerator "$@"
Binary file added application.linux64/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added application.linux64/lib/SpriteSheetGenerator.jar
Binary file not shown.
Binary file added application.linux64/lib/core.jar
Binary file not shown.
Binary file not shown.
Binary file added application.linux64/lib/gluegen-rt.jar
Binary file not shown.
Binary file not shown.
Binary file added application.linux64/lib/jogl-all.jar
Binary file not shown.
96 changes: 96 additions & 0 deletions application.linux64/source/SpriteSheetGenerator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;

import javax.swing.JOptionPane;
import java.io.File;

import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class SpriteSheetGenerator extends PApplet {




PImage[] images;
boolean draw;
PImage background;
int imageHeight;

public void setup()
{
background = new PImage();
String number = JOptionPane.showInputDialog("How many Pictures are there?");
int imageNumber = Integer.parseInt(number);
images = new PImage[imageNumber];
println(imageNumber);
String h = JOptionPane.showInputDialog("How tall is each picture?");
imageHeight = Integer.parseInt(h);
selectFolder("Please Select The Folder: ", "folderSelectCallback");
frame.setResizable(true);
size(imageHeight, imageHeight);
background(255);
frameRate(60);
draw = false;
}

int i = 0;
int x = 0;
public void draw()
{
if(draw)
{
i++;
if(i == images.length)
{
exit();
}
int x = 0;
for(int j = 0; j < i; j++)
{
PImage image = images[j];
image(image, x, 0, image.width, imageHeight);
x += image.width;
}

println(x);
frame.setSize(x, imageHeight);
saveFrame("file.png");
}
}

public void folderSelectCallback(File folder)
{
if (folder == null) {
println("Window was closed or the user hit cancel.");
exit();
} else {
String path = folder.getAbsolutePath();
println("User selected " + path);

for(int i = 0; i < images.length; i++)
{
images[i] = loadImage(path+File.separator+String.format("%04d", i+1)+".png");
}

draw = true;

}
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "SpriteSheetGenerator" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
68 changes: 68 additions & 0 deletions application.linux64/source/SpriteSheetGenerator.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import javax.swing.JOptionPane;
import java.io.File;

PImage[] images;
boolean draw;
PImage background;
int imageHeight;

void setup()
{
background = new PImage();
String number = JOptionPane.showInputDialog("How many Pictures are there?");
int imageNumber = Integer.parseInt(number);
images = new PImage[imageNumber];
println(imageNumber);
String h = JOptionPane.showInputDialog("How tall is each picture?");
imageHeight = Integer.parseInt(h);
selectFolder("Please Select The Folder: ", "folderSelectCallback");
frame.setResizable(true);
size(imageHeight, imageHeight);
background(255);
frameRate(60);
draw = false;
}

int i = 0;
int x = 0;
void draw()
{
if(draw)
{
i++;
if(i == images.length)
{
exit();
}
int x = 0;
for(int j = 0; j < i; j++)
{
PImage image = images[j];
image(image, x, 0, image.width, imageHeight);
x += image.width;
}

println(x);
frame.setSize(x, imageHeight);
saveFrame("file.png");
}
}

void folderSelectCallback(File folder)
{
if (folder == null) {
println("Window was closed or the user hit cancel.");
exit();
} else {
String path = folder.getAbsolutePath();
println("User selected " + path);

for(int i = 0; i < images.length; i++)
{
images[i] = loadImage(path+File.separator+String.format("%04d", i+1)+".png");
}

draw = true;

}
}

0 comments on commit c5d8862

Please sign in to comment.