sprite assembler test assets

This commit is contained in:
minjaesong
2019-01-06 00:30:43 +09:00
parent 73af014ea4
commit 9b0ea53c2d
18 changed files with 85 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ class ADPropertyObject(propertyRaw: String) {
/** example valid input: ```LEG_RIGHT 0,1``` */
fun isADvariable(property: String) = variableInputSepRegex.containsMatchIn(property)
/** example valid input: ```sprites/test.tga``` */
/** example valid input: ```sprites/test``` */
fun isADstring(property: String) = !isADvariable(property)
}

View File

@@ -74,7 +74,7 @@ If a field is recognised as an animation (in this case ANIM_RUN), the assembler
### Naming convention of files
If the animation specifies a "body part" (in this example LEG_LEFT and LEG_RIGHT), the assembler will look for a file ```sprites/test_leg_left.tga.gz``` and ```sprites/test_leg_right.tga.gz``` respectively.
If the animation specifies a "body part" (in this example LEG_LEFT and LEG_RIGHT), the assembler will look for a file ```sprites/test_leg_left.tga.gz``` and ```sprites/test_leg_right.tga.gz``` respectively. Filenames are advised to be kept all lowercase.
#### Reserved keywords

View File

@@ -3,6 +3,8 @@ package net.torvald.spriteassembler;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@@ -18,6 +20,8 @@ public class SpriteAssemblerApp extends JFrame {
private JTextPane panelCode = new JTextPane();
private JTextArea statBar = new JTextArea("Null.");
public SpriteAssemblerApp() {
JSplitPane panelDataView = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(panelProperties), new JScrollPane(panelBodypartsList));
@@ -26,6 +30,12 @@ public class SpriteAssemblerApp extends JFrame {
JMenuBar menu = new JMenuBar();
menu.add(new JMenu("File"));
menu.add(new JMenu("Parse")).addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
System.out.println("Hello");
}
});
menu.add(new JMenu("Run"));
this.setLayout(new BorderLayout());

View File

@@ -0,0 +1,32 @@
SPRITESHEET=mods/basegame/sprites/sprite_assembler_test_assets/test_
EXTENSION=.tga
# note to self: don't implement skeleton hierarchy: there's too many exceptions
# besides, you have "ALL" key.
! a skeleton also defines what body parts (images) be used.
! you can also write multiline text using reverse solidus; this is a feature of .properties
! skeleton joints are ordered: foremost-drawn object comes first, which means lowermost object IN THIS LIST
! are painted first, and any object that comes before it will paint over it. In other words, this list is
! first reversed then being iterated.
! Joints' original point is defined in the document sprite_joints.psd. It also has visual representations.
# TODO right now accessory points are explicitly defined. Should they be injected in run-time?
SKELETON_STAND=HEADGEAR 0,32;HAIR_FORE 0,32;\
ARM_REST_RIGHT -7,23;HAND_REST_RIGHT -6,11;HELD_ITEM -6,11;\
HAIR 0,32;HEAD 0,32;\
UPPER_TORSO 0,23;LOWER_TORSO 0,15;\
FOOT_RIGHT -2,2;LEG_RIGHT -2,7;\
FOOT_LEFT 2,2;LEG_LEFT 2,7;\
ARM_REST_LEFT 5,24;HAND_REST_LEFT 6,12
# skeleton_stand is used for testing purpose
ANIM_RUN=DELAY 0.15;ROW 2;SKELETON SKELETON_STAND
ANIM_RUN_1=LEG_RIGHT 1,-1;LEG_LEFT -1,0
ANIM_RUN_2=ALL 0,-1;LEG_RIGHT 0,1;LEG_LEFT 0,-1
ANIM_RUN_3=LEG_RIGHT -1,0;LEG_LEFT 1,-1
ANIM_RUN_4=ALL 0,-1;LEG_RIGHT 0,-1;LEG_LEFT 0,1
ANIM_IDLE=DELAY 2;ROW 1;SKELETON SKELETON_STAND
ANIM_IDLE_1=
! ANIM_IDLE_1 will not make any transformation
ANIM_IDLE_2=UPPER_TORSO 0,-1

View File

@@ -9,8 +9,8 @@ import java.io.StringReader
class ADLParsingTest {
val TEST_STR = """
SPRITESHEET=sprites/test
EXTENSION=.tga.gz
SPRITESHEET=mods/basegame/sprites/sprite_assembler_test_assets/test_
EXTENSION=.tga
# note to self: don't implement skeleton hierarchy: there's too many exceptions
# besides, you have "ALL" key.