-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
336 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
} |