mirror of
https://github.com/ynerant/Level-Editor.git
synced 2025-07-04 14:52:15 +02:00
Ajouté entièrement l'enregistrement des sprites
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
package galaxyoyo.unknown.client.main;
|
||||
|
||||
import galaxyoyo.unknown.api.editor.EditorAPI;
|
||||
import galaxyoyo.unknown.api.editor.sprites.SpriteRegister;
|
||||
import galaxyoyo.unknown.frame.MainFrame;
|
||||
|
||||
import java.awt.Color;
|
||||
@ -103,6 +104,8 @@ public class Main
|
||||
}
|
||||
}
|
||||
|
||||
SpriteRegister.refreshAllSprites();
|
||||
|
||||
if (set.has(edit))
|
||||
{
|
||||
launchEditMode();
|
||||
|
@ -1,14 +1,22 @@
|
||||
package galaxyoyo.unknown.editor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import galaxyoyo.unknown.api.editor.sprites.Sprite;
|
||||
|
||||
public class Editor
|
||||
{
|
||||
private final EditorFrame frame;
|
||||
private byte[] bytes;
|
||||
private List<List<Sprite>> sprites = new ArrayList<List<Sprite>>();
|
||||
|
||||
public Editor(byte[] bytes)
|
||||
{
|
||||
frame = new EditorFrame();
|
||||
frame = new EditorFrame(this);
|
||||
this.bytes = bytes;
|
||||
|
||||
getFrame().setVisible(true);
|
||||
}
|
||||
|
||||
public EditorFrame getFrame()
|
||||
@ -25,4 +33,9 @@ public class Editor
|
||||
{
|
||||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
public Sprite getSprite(int x, int y)
|
||||
{
|
||||
return sprites.get(x).get(y);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,12 @@ import javax.swing.JFrame;
|
||||
public class EditorFrame extends JFrame
|
||||
{
|
||||
private static final long serialVersionUID = -2705122356101556462L;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Editor editor;
|
||||
|
||||
public EditorFrame()
|
||||
public EditorFrame(Editor editor)
|
||||
{
|
||||
this.editor = editor;
|
||||
}
|
||||
}
|
||||
|
BIN
src/main/resources/assets/unknown/textures/sprites/gazon.png
Normal file
BIN
src/main/resources/assets/unknown/textures/sprites/gazon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,11 @@
|
||||
{
|
||||
"gazon": [
|
||||
[0,15,1,5],
|
||||
[0,144,1,3],
|
||||
[16,144,2,2],
|
||||
[32,208,6,2],
|
||||
[128,144,1,2],
|
||||
[160,156,3,2],
|
||||
[160,32,1,3]
|
||||
]
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user