Implemented full Android support
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -24,10 +24,10 @@ public class Control extends RendererModule{
|
|||||||
public int rangex = 10, rangey = 10;
|
public int rangex = 10, rangey = 10;
|
||||||
public float targetzoom = 1f;
|
public float targetzoom = 1f;
|
||||||
private float targetx, targety;
|
private float targetx, targety;
|
||||||
//GifRecorder recoder = new GifRecorder(batch);
|
//GifRecorder recorder = new GifRecorder(batch);
|
||||||
|
|
||||||
public Control(){
|
public Control(){
|
||||||
cameraScale = 4;
|
cameraScale = baseCameraScale;
|
||||||
pixelate();
|
pixelate();
|
||||||
|
|
||||||
Gdx.input.setCatchBackKey(true);
|
Gdx.input.setCatchBackKey(true);
|
||||||
@@ -142,7 +142,7 @@ public class Control extends RendererModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(core.block() == ProductionBlocks.core){
|
if(core.block() == ProductionBlocks.core){
|
||||||
smoothCamera(player.x, player.y, 0.3f);
|
smoothCamera(player.x, player.y, android ? 0.3f : 0.14f);
|
||||||
}else{
|
}else{
|
||||||
smoothCamera(core.worldx(), core.worldy(), 0.4f);
|
smoothCamera(core.worldx(), core.worldy(), 0.4f);
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,14 @@ public class Control extends RendererModule{
|
|||||||
clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f);
|
clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f);
|
||||||
|
|
||||||
float lastx = camera.position.x, lasty = camera.position.y;
|
float lastx = camera.position.x, lasty = camera.position.y;
|
||||||
camera.position.set((int)camera.position.x, (int)camera.position.y, 0);
|
|
||||||
|
if(android){
|
||||||
|
camera.position.set((int)camera.position.x, (int)camera.position.y, 0);
|
||||||
|
|
||||||
|
if(Gdx.graphics.getHeight()/cameraScale % 2 == 1){
|
||||||
|
camera.position.add(0, -0.5f, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
drawDefault();
|
drawDefault();
|
||||||
|
|
||||||
@@ -162,7 +169,7 @@ public class Control extends RendererModule{
|
|||||||
|
|
||||||
camera.position.set(lastx, lasty, 0);
|
camera.position.set(lastx, lasty, 0);
|
||||||
|
|
||||||
//recoder.update();
|
//recorder.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!paused){
|
if(!paused){
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.badlogic.gdx.graphics.g2d.Batch;
|
|||||||
import com.badlogic.gdx.math.Interpolation;
|
import com.badlogic.gdx.math.Interpolation;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.Timer;
|
||||||
|
import com.badlogic.gdx.utils.Timer.Task;
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.Weapon;
|
import io.anuke.mindustry.entities.Weapon;
|
||||||
import io.anuke.mindustry.input.AndroidInput;
|
import io.anuke.mindustry.input.AndroidInput;
|
||||||
@@ -22,13 +24,13 @@ import io.anuke.ucore.function.VisibilityProvider;
|
|||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
import io.anuke.ucore.graphics.Textures;
|
import io.anuke.ucore.graphics.Textures;
|
||||||
import io.anuke.ucore.modules.SceneModule;
|
import io.anuke.ucore.modules.SceneModule;
|
||||||
|
import io.anuke.ucore.scene.Element;
|
||||||
import io.anuke.ucore.scene.Scene;
|
import io.anuke.ucore.scene.Scene;
|
||||||
import io.anuke.ucore.scene.actions.Actions;
|
import io.anuke.ucore.scene.actions.Actions;
|
||||||
import io.anuke.ucore.scene.builders.*;
|
import io.anuke.ucore.scene.builders.*;
|
||||||
|
import io.anuke.ucore.scene.event.InputEvent;
|
||||||
import io.anuke.ucore.scene.ui.*;
|
import io.anuke.ucore.scene.ui.*;
|
||||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
import io.anuke.ucore.scene.ui.layout.*;
|
||||||
import io.anuke.ucore.scene.ui.layout.Stack;
|
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
|
||||||
import io.anuke.ucore.util.Timers;
|
import io.anuke.ucore.util.Timers;
|
||||||
|
|
||||||
public class UI extends SceneModule{
|
public class UI extends SceneModule{
|
||||||
@@ -36,6 +38,7 @@ public class UI extends SceneModule{
|
|||||||
SettingsDialog prefs;
|
SettingsDialog prefs;
|
||||||
KeybindDialog keys;
|
KeybindDialog keys;
|
||||||
Dialog about, menu, restart, tutorial, levels, upgrades;
|
Dialog about, menu, restart, tutorial, levels, upgrades;
|
||||||
|
Tooltip tooltip;
|
||||||
|
|
||||||
VisibilityProvider play = () -> {
|
VisibilityProvider play = () -> {
|
||||||
return playing;
|
return playing;
|
||||||
@@ -60,6 +63,7 @@ public class UI extends SceneModule{
|
|||||||
});
|
});
|
||||||
|
|
||||||
skin.font().setUseIntegerPositions(false);
|
skin.font().setUseIntegerPositions(false);
|
||||||
|
skin.font().getData().setScale(Vars.fontscale);
|
||||||
TooltipManager.getInstance().animations = false;
|
TooltipManager.getInstance().animations = false;
|
||||||
|
|
||||||
Dialog.closePadR = -1;
|
Dialog.closePadR = -1;
|
||||||
@@ -88,12 +92,12 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
|
||||||
Draw.tscl(1.5f);
|
Draw.tscl(Unit.dp.inPixels(1.5f));
|
||||||
|
|
||||||
Draw.text("[#111111]-( Mindustry )-", w/2, h-16);
|
Draw.text("[#111111]-( Mindustry )-", w/2, h-Unit.dp.inPixels(16));
|
||||||
Draw.text("[#f1de60]-( Mindustry )-", w/2, h-10);
|
Draw.text("[#f1de60]-( Mindustry )-", w/2, h-Unit.dp.inPixels(10));
|
||||||
|
|
||||||
Draw.tscl(0.5f);
|
Draw.tscl(Unit.dp.inPixels(0.5f));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -199,8 +203,8 @@ public class UI extends SceneModule{
|
|||||||
Recipe.getBy(sec, recipes);
|
Recipe.getBy(sec, recipes);
|
||||||
|
|
||||||
ImageButton button = new ImageButton("icon-"+sec.name(), "toggle");
|
ImageButton button = new ImageButton("icon-"+sec.name(), "toggle");
|
||||||
add(button).fill().height(54).padTop(-10);
|
add(button).fill().height(54).padTop(-10).units(Unit.dp);
|
||||||
button.getImageCell().size(40).padBottom(4);
|
button.getImageCell().size(40).padBottom(4).units(Unit.dp);
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
Table table = new Table();
|
Table table = new Table();
|
||||||
@@ -216,8 +220,8 @@ public class UI extends SceneModule{
|
|||||||
recipe = r;
|
recipe = r;
|
||||||
});
|
});
|
||||||
|
|
||||||
table.add(image).size(size+8).pad(4);
|
table.add(image).size(size+8).pad(4).units(Unit.dp);
|
||||||
image.getImageCell().size(size);
|
image.getImageCell().size(size).units(Unit.dp);
|
||||||
|
|
||||||
image.update(()->{
|
image.update(()->{
|
||||||
|
|
||||||
@@ -241,7 +245,7 @@ public class UI extends SceneModule{
|
|||||||
String description = r.result.description();
|
String description = r.result.description();
|
||||||
|
|
||||||
tiptable.background("button");
|
tiptable.background("button");
|
||||||
tiptable.add("[PURPLE]" + r.result.name(), 0.75f).left().padBottom(2f);
|
tiptable.add("[PURPLE]" + r.result.name(), 0.75f*fontscale*2f).left().padBottom(2f).units(Unit.dp);
|
||||||
|
|
||||||
ItemStack[] req = r.requirements;
|
ItemStack[] req = r.requirements;
|
||||||
for(ItemStack s : req){
|
for(ItemStack s : req){
|
||||||
@@ -249,19 +253,42 @@ public class UI extends SceneModule{
|
|||||||
int amount = Math.min(items.get(s.item, 0), s.amount);
|
int amount = Math.min(items.get(s.item, 0), s.amount);
|
||||||
tiptable.add(
|
tiptable.add(
|
||||||
(amount >= s.amount ? "[YELLOW]" : "[RED]")
|
(amount >= s.amount ? "[YELLOW]" : "[RED]")
|
||||||
+s.item + ": " + amount + " / " +s.amount, 0.5f).left();
|
+s.item + ": " + amount + " / " +s.amount, fontscale).left();
|
||||||
}
|
}
|
||||||
|
|
||||||
tiptable.row();
|
tiptable.row();
|
||||||
tiptable.add().size(10);
|
tiptable.add().size(10).units(Unit.px);
|
||||||
tiptable.row();
|
tiptable.row();
|
||||||
tiptable.add("[ORANGE]" + description).left();
|
tiptable.add("[ORANGE]" + description).left();
|
||||||
tiptable.pad(10f);
|
tiptable.pad(Unit.dp.inPixels(10f));
|
||||||
};
|
};
|
||||||
|
|
||||||
run.listen();
|
run.listen();
|
||||||
|
|
||||||
Tooltip tip = new Tooltip(tiptable, run);
|
Tooltip tip = new Tooltip(tiptable, run){
|
||||||
|
public void enter (InputEvent event, float x, float y, int pointer, Element fromActor) {
|
||||||
|
if(tooltip != this)
|
||||||
|
hideTooltip();
|
||||||
|
Element actor = event.getListenerActor();
|
||||||
|
if (fromActor != null && fromActor.isDescendantOf(actor)) return;
|
||||||
|
setContainerPosition(actor, x, y);
|
||||||
|
manager.enter(this);
|
||||||
|
run.listen();
|
||||||
|
|
||||||
|
tooltip = this;
|
||||||
|
|
||||||
|
if(android){
|
||||||
|
|
||||||
|
Timer.schedule(new Task(){
|
||||||
|
@Override
|
||||||
|
public void run(){
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
}, 1.5f);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
tip.setInstant(true);
|
tip.setInstant(true);
|
||||||
|
|
||||||
@@ -326,26 +353,26 @@ public class UI extends SceneModule{
|
|||||||
aright();
|
aright();
|
||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
get().background("button");
|
get().background("button");
|
||||||
|
|
||||||
new label("Wave 1"){{
|
new label("Wave 1"){{
|
||||||
get().setFontScale(1f);
|
get().setFontScale(fontscale*2f);
|
||||||
get().update(() -> {
|
get().update(() -> {
|
||||||
get().setText("[YELLOW]Wave " + wave);
|
get().setText("[YELLOW]Wave " + wave);
|
||||||
});
|
});
|
||||||
}}.left();
|
}}.left();
|
||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
new label("Time"){{
|
new label("Time"){{
|
||||||
get().update(() -> {
|
get().update(() -> {
|
||||||
get().setText(enemies > 0 ?
|
get().setText(enemies > 0 ?
|
||||||
enemies + " Enemies remaining" : "New wave in " + (int) (wavetime / 60f));
|
enemies + " Enemies remaining" : "New wave in " + (int) (wavetime / 60f));
|
||||||
});
|
});
|
||||||
}}.minWidth(150);
|
}}.minWidth(150);
|
||||||
|
|
||||||
get().pad(12);
|
get().pad(Unit.dp.inPixels(12));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
get().setVisible(play);
|
get().setVisible(play);
|
||||||
}}.end();
|
}}.end();
|
||||||
@@ -356,23 +383,26 @@ public class UI extends SceneModule{
|
|||||||
new table(){{
|
new table(){{
|
||||||
aleft();
|
aleft();
|
||||||
abottom();
|
abottom();
|
||||||
|
int base = baseCameraScale;
|
||||||
new button("+", ()->{
|
new button("+", ()->{
|
||||||
if(control.cameraScale < 4){
|
if(control.cameraScale < base){
|
||||||
control.cameraScale = 4;
|
control.cameraScale = base;
|
||||||
control.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
control.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||||
|
control.setCamera(player.x, player.y);
|
||||||
Draw.getSurface("pixel").setScale(control.cameraScale);
|
Draw.getSurface("pixel").setScale(control.cameraScale);
|
||||||
Draw.getSurface("shadow").setScale(control.cameraScale);
|
Draw.getSurface("shadow").setScale(control.cameraScale);
|
||||||
}
|
}
|
||||||
}).size(40);
|
}).size(Unit.dp.inPixels(40));
|
||||||
|
|
||||||
new button("-", ()->{
|
new button("-", ()->{
|
||||||
if(control.cameraScale > 3){
|
if(control.cameraScale > base-zoomScale){
|
||||||
control.cameraScale = 3;
|
control.cameraScale = base-zoomScale;
|
||||||
control.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
control.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||||
|
control.setCamera(player.x, player.y);
|
||||||
Draw.getSurface("pixel").setScale(control.cameraScale);
|
Draw.getSurface("pixel").setScale(control.cameraScale);
|
||||||
Draw.getSurface("shadow").setScale(control.cameraScale);
|
Draw.getSurface("shadow").setScale(control.cameraScale);
|
||||||
}
|
}
|
||||||
}).size(40);
|
}).size(Unit.dp.inPixels(40));
|
||||||
|
|
||||||
get().setVisible(play);
|
get().setVisible(play);
|
||||||
}}.end();
|
}}.end();
|
||||||
@@ -380,7 +410,7 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
//menu table
|
//menu table
|
||||||
new table(){{
|
new table(){{
|
||||||
float w = 200;
|
float w = Unit.dp.inPixels(200);
|
||||||
|
|
||||||
new table("button"){{
|
new table("button"){{
|
||||||
new button("Play", () -> {
|
new button("Play", () -> {
|
||||||
@@ -440,15 +470,15 @@ public class UI extends SceneModule{
|
|||||||
}}.end();
|
}}.end();
|
||||||
|
|
||||||
tools = new Table();
|
tools = new Table();
|
||||||
tools.addIButton("icon-cancel", 42, ()->{
|
tools.addIButton("icon-cancel", Unit.dp.inPixels(42), ()->{
|
||||||
recipe = null;
|
recipe = null;
|
||||||
});
|
});
|
||||||
tools.addIButton("icon-rotate", 42, ()->{
|
tools.addIButton("icon-rotate", Unit.dp.inPixels(42), ()->{
|
||||||
rotation++;
|
rotation++;
|
||||||
|
|
||||||
rotation %= 4;
|
rotation %= 4;
|
||||||
});
|
});
|
||||||
tools.addIButton("icon-check", 42, ()->{
|
tools.addIButton("icon-check", Unit.dp.inPixels(42), ()->{
|
||||||
AndroidInput.place();
|
AndroidInput.place();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -460,7 +490,7 @@ public class UI extends SceneModule{
|
|||||||
});
|
});
|
||||||
|
|
||||||
tools.update(()->{
|
tools.update(()->{
|
||||||
tools.setPosition(AndroidInput.mousex, Gdx.graphics.getHeight()-AndroidInput.mousey-60, Align.top);
|
tools.setPosition(AndroidInput.mousex, Gdx.graphics.getHeight()-AndroidInput.mousey-15*control.cameraScale, Align.top);
|
||||||
});
|
});
|
||||||
|
|
||||||
updateItems();
|
updateItems();
|
||||||
@@ -524,14 +554,19 @@ public class UI extends SceneModule{
|
|||||||
restart.show();
|
restart.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void hideTooltip(){
|
||||||
|
if(tooltip != null)
|
||||||
|
tooltip.hide();
|
||||||
|
}
|
||||||
|
|
||||||
public void updateItems(){
|
public void updateItems(){
|
||||||
itemtable.clear();
|
itemtable.clear();
|
||||||
|
|
||||||
for(Item stack : items.keys()){
|
for(Item stack : items.keys()){
|
||||||
Image image = new Image(Draw.region("icon-" + stack.name()));
|
Image image = new Image(Draw.region("icon-" + stack.name()));
|
||||||
Label label = new Label("" + items.get(stack));
|
Label label = new Label("" + items.get(stack));
|
||||||
label.setFontScale(1f);
|
label.setFontScale(fontscale*2f);
|
||||||
itemtable.add(image).size(32);
|
itemtable.add(image).size(32).units(Unit.dp);
|
||||||
itemtable.add(label);
|
itemtable.add(label);
|
||||||
itemtable.row();
|
itemtable.row();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.mindustry.entities.Weapon;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.Recipe;
|
import io.anuke.mindustry.resource.Recipe;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
/**ick, global state*/
|
/**ick, global state*/
|
||||||
public class Vars{
|
public class Vars{
|
||||||
@@ -23,6 +24,9 @@ public class Vars{
|
|||||||
public static final float wavespace = 20*60*(android ? 2 : 1);
|
public static final float wavespace = 20*60*(android ? 2 : 1);
|
||||||
public static final float enemyspawnspace = 65;
|
public static final float enemyspawnspace = 65;
|
||||||
public static boolean debug = false;
|
public static boolean debug = false;
|
||||||
|
public static float fontscale = Unit.dp.inPixels(1f)/2f;
|
||||||
|
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
|
||||||
|
public static final int zoomScale = Math.round(Unit.dp.inPixels(1));
|
||||||
|
|
||||||
public static final Vector2 vector = new Vector2();
|
public static final Vector2 vector = new Vector2();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public class AndroidInput extends InputAdapter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
|
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
|
||||||
|
ui.hideTooltip();
|
||||||
if(pointer == 0){
|
if(pointer == 0){
|
||||||
lmousex = screenX;
|
lmousex = screenX;
|
||||||
lmousey = screenY;
|
lmousey = screenY;
|
||||||
@@ -118,4 +119,13 @@ public class AndroidInput extends InputAdapter{
|
|||||||
breaktime = 0;
|
breaktime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int touches(){
|
||||||
|
int sum = 0;
|
||||||
|
for(int i = 0; i < 10; i ++){
|
||||||
|
if(Gdx.input.isTouched(i))
|
||||||
|
sum ++;
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import io.anuke.mindustry.GameState;
|
|||||||
import io.anuke.mindustry.World;
|
import io.anuke.mindustry.World;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.scene.ui.*;
|
import io.anuke.ucore.scene.ui.*;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class LevelDialog extends Dialog{
|
public class LevelDialog extends Dialog{
|
||||||
Label[] scores = new Label[maps.length];
|
Label[] scores = new Label[maps.length];
|
||||||
@@ -46,8 +47,8 @@ public class LevelDialog extends Dialog{
|
|||||||
image.clicked(()->{
|
image.clicked(()->{
|
||||||
selectedMap = index;
|
selectedMap = index;
|
||||||
});
|
});
|
||||||
image.getImageCell().size(164);
|
image.getImageCell().size(Unit.dp.inPixels(164));
|
||||||
content().add(image).size(180);
|
content().add(image).size(Unit.dp.inPixels(180));
|
||||||
}
|
}
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
|
|
||||||
import io.anuke.ucore.scene.ui.ConfirmDialog;
|
import io.anuke.ucore.scene.ui.ConfirmDialog;
|
||||||
import io.anuke.ucore.scene.ui.Dialog;
|
import io.anuke.ucore.scene.ui.Dialog;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class MenuDialog extends Dialog{
|
public class MenuDialog extends Dialog{
|
||||||
|
|
||||||
@@ -16,17 +17,17 @@ public class MenuDialog extends Dialog{
|
|||||||
content().addButton("Back", ()->{
|
content().addButton("Back", ()->{
|
||||||
hide();
|
hide();
|
||||||
paused = false;
|
paused = false;
|
||||||
}).width(200);
|
}).width(200).units(Unit.dp);
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
content().addButton("Settings", ()->{
|
content().addButton("Settings", ()->{
|
||||||
ui.showPrefs();
|
ui.showPrefs();
|
||||||
}).width(200);
|
}).width(200).units(Unit.dp);
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
content().addButton("Controls", ()->{
|
content().addButton("Controls", ()->{
|
||||||
ui.showControls();
|
ui.showControls();
|
||||||
}).width(200);
|
}).width(200).units(Unit.dp);
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
content().addButton("Back to menu", ()->{
|
content().addButton("Back to menu", ()->{
|
||||||
@@ -35,6 +36,6 @@ public class MenuDialog extends Dialog{
|
|||||||
paused = false;
|
paused = false;
|
||||||
playing = false;
|
playing = false;
|
||||||
}).show();
|
}).show();
|
||||||
}).width(200);
|
}).width(200).units(Unit.dp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static io.anuke.mindustry.Vars.tilesize;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
@@ -49,7 +50,7 @@ public class Drill extends Block{
|
|||||||
Draw.text("Not on " + resource.name + " block!", tile.worldx(), tile.worldy() + tilesize);
|
Draw.text("Not on " + resource.name + " block!", tile.worldx(), tile.worldy() + tilesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.tscl(0.5f);
|
Draw.tscl(Vars.fontscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static io.anuke.mindustry.Vars.tilesize;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.math.MathUtils;
|
import com.badlogic.gdx.math.MathUtils;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.entities.*;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@@ -60,7 +61,7 @@ public class Turret extends Block{
|
|||||||
Draw.text("Ammo: " + entity.ammo, tile.worldx(), tile.worldy() - tilesize);
|
Draw.text("Ammo: " + entity.ammo, tile.worldx(), tile.worldy() - tilesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.tscl(0.5f);
|
Draw.tscl(Vars.fontscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||