Splitting UI atlas
|
Before Width: | Height: | Size: 8.9 KiB |
8
core/assets-raw/sprites/ui/pack.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
duplicatePadding: true,
|
||||||
|
combineSubdirectories: true,
|
||||||
|
flattenPaths: true,
|
||||||
|
maxWidth: 2048,
|
||||||
|
maxHeight: 2048,
|
||||||
|
fast: true
|
||||||
|
}
|
||||||
8
core/assets-raw/sprites/ui/pack_fallback.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
duplicatePadding: true,
|
||||||
|
combineSubdirectories: true,
|
||||||
|
flattenPaths: true,
|
||||||
|
maxWidth: 1024,
|
||||||
|
maxHeight: 1024,
|
||||||
|
fast: true
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 1019 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 254 KiB |
BIN
core/assets/sprites/sprites5.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
@@ -2,12 +2,9 @@ package io.anuke.mindustry;
|
|||||||
|
|
||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.Texture;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.graphics.g2d.SpriteBatch;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.util.Log;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Time;
|
|
||||||
import io.anuke.mindustry.core.*;
|
import io.anuke.mindustry.core.*;
|
||||||
import io.anuke.mindustry.game.EventType.GameLoadEvent;
|
import io.anuke.mindustry.game.EventType.GameLoadEvent;
|
||||||
import io.anuke.mindustry.io.BundleLoader;
|
import io.anuke.mindustry.io.BundleLoader;
|
||||||
@@ -64,12 +61,12 @@ public class Mindustry extends ApplicationCore{
|
|||||||
Core.graphics.clear(Color.BLACK);
|
Core.graphics.clear(Color.BLACK);
|
||||||
Draw.proj().setOrtho(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
|
Draw.proj().setOrtho(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||||
|
|
||||||
Texture icon = new Texture("sprites/logotext.png");
|
//Texture icon = new Texture("sprites/logotext.png");
|
||||||
float width = Math.min(Core.graphics.getWidth() - 10f, icon.getWidth());
|
//float width = Math.min(Core.graphics.getWidth() - 10f, icon.getWidth());
|
||||||
Draw.rect(Draw.wrap(icon), Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, width, (float)icon.getHeight() / icon.getWidth() * width);
|
//Draw.rect(Draw.wrap(icon), Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, width, (float)icon.getHeight() / icon.getWidth() * width);
|
||||||
Draw.flush();
|
//Draw.flush();
|
||||||
|
|
||||||
icon.dispose();
|
//icon.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ task tileImages(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task pack(){
|
task pack(dependsOn: classes){
|
||||||
|
|
||||||
doLast{
|
doLast{
|
||||||
//cleanup old sprites
|
//cleanup old sprites
|
||||||
@@ -281,7 +281,6 @@ task pack(){
|
|||||||
//run generation task; generate all needed sprites
|
//run generation task; generate all needed sprites
|
||||||
file(genFolder).mkdirs()
|
file(genFolder).mkdirs()
|
||||||
javaexec{
|
javaexec{
|
||||||
|
|
||||||
main = "io.anuke.mindustry.ImagePacker"
|
main = "io.anuke.mindustry.ImagePacker"
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
standardInput = System.in
|
standardInput = System.in
|
||||||
|
|||||||