New shaders, remake of Android placement partially done
This commit is contained in:
@@ -15,17 +15,27 @@ import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Inputs;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.CapStyle;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.graphics.*;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class OverlayRenderer {
|
||||
|
||||
public void draw(){
|
||||
public void drawBottom(){
|
||||
for(Player player : players) {
|
||||
InputHandler input = control.input(player.playerIndex);
|
||||
|
||||
Shaders.outline.color.set(Palette.accent);
|
||||
Graphics.beginShaders(Shaders.outline);
|
||||
|
||||
input.drawBottom();
|
||||
|
||||
Graphics.endShaders();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawTop(){
|
||||
|
||||
for(Player player : players) {
|
||||
|
||||
@@ -37,7 +47,7 @@ public class OverlayRenderer {
|
||||
tile.block().drawConfigure(tile);
|
||||
}
|
||||
|
||||
input.draw();
|
||||
input.drawTop();
|
||||
|
||||
Draw.reset();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Palette {
|
||||
public static final Color place = Color.valueOf("6335f8");
|
||||
public static final Color remove = Color.valueOf("e55454");
|
||||
public static final Color placeRotate = Color.ORANGE;
|
||||
public static final Color breakInvalid = Color.SCARLET;
|
||||
public static final Color breakInvalid = Color.valueOf("d44b3d");
|
||||
public static final Color range = Color.valueOf("f4ba6e");
|
||||
public static final Color power = Color.valueOf("fbd367");
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ public class Shaders{
|
||||
public static SurfaceShader oil;
|
||||
public static Space space;
|
||||
public static UnitBuild build;
|
||||
public static Shader hit;
|
||||
public static MixShader mix;
|
||||
public static Shader fullMix;
|
||||
|
||||
public static void init(){
|
||||
outline = new Outline();
|
||||
@@ -34,7 +35,22 @@ public class Shaders{
|
||||
oil = new SurfaceShader("oil");
|
||||
space = new Space();
|
||||
build = new UnitBuild();
|
||||
hit = new Shader("hit", "default");
|
||||
mix = new MixShader();
|
||||
fullMix = new Shader("fullmix", "default");
|
||||
}
|
||||
|
||||
public static class MixShader extends Shader{
|
||||
public Color color = new Color(Color.WHITE);
|
||||
|
||||
public MixShader(){
|
||||
super("mix", "default");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
super.apply();
|
||||
shader.setUniformf("u_color", color);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Space extends SurfaceShader{
|
||||
|
||||
Reference in New Issue
Block a user