Misc. in-game UI polish
This commit is contained in:
+35
-4
@@ -1,11 +1,42 @@
|
||||
package io.anuke.mindustry.graphics;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
import io.anuke.arc.math.*;
|
||||
import io.anuke.arc.util.*;
|
||||
|
||||
public class Shapes{
|
||||
public class Drawf{
|
||||
|
||||
public static void dashCircle(float x, float y, float rad, Color color){
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.dashCircle(x, y, rad);
|
||||
Lines.stroke(1f, color);
|
||||
Lines.dashCircle(x, y, rad);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
public static void circles(float x, float y, float rad, Color color){
|
||||
int vertices = 30;
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.poly(x, y, vertices, rad);
|
||||
Lines.stroke(1f, color);
|
||||
Lines.poly(x, y, vertices, rad);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
public static void arrow(float x, float y, float x2, float y2, float length, float radius){
|
||||
float angle = Angles.angle(x, y, x2, y2);
|
||||
float space = 2f;
|
||||
Tmp.v1.set(x2, y2).sub(x, y).limit(length);
|
||||
float vx = Tmp.v1.x + x, vy = Tmp.v1.y + y;
|
||||
|
||||
Draw.color(Pal.gray);
|
||||
Fill.poly(vx, vy, 3, radius + space, angle);
|
||||
Draw.color(Pal.accent);
|
||||
Fill.poly(vx, vy, 3, radius, angle);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
public static void laser(TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float scale){
|
||||
laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale);
|
||||
@@ -105,7 +105,7 @@ public class OverlayRenderer{
|
||||
|
||||
Draw.reset();
|
||||
|
||||
//draw selected block bars and info
|
||||
//draw selected block
|
||||
if(input.block == null && !Core.scene.hasMouse()){
|
||||
Vector2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY());
|
||||
Tile tile = world.ltileWorld(vec.x, vec.y);
|
||||
@@ -115,6 +115,7 @@ public class OverlayRenderer{
|
||||
}
|
||||
}
|
||||
|
||||
//draw selection overlay when dropping item
|
||||
if(input.isDroppingItem()){
|
||||
Vector2 v = Core.input.mouseWorld(input.getMouseX(), input.getMouseY());
|
||||
float size = 8;
|
||||
@@ -125,9 +126,12 @@ public class OverlayRenderer{
|
||||
|
||||
Tile tile = world.ltileWorld(v.x, v.y);
|
||||
if(tile != null && tile.interactable(player.getTeam()) && tile.block().acceptStack(player.item().item, player.item().amount, tile, player) > 0){
|
||||
Draw.color(Pal.place);
|
||||
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 1 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Draw.color();
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Lines.stroke(1f, Pal.place);
|
||||
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 2 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Draw.reset();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user