mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
New overdrive visuals for colorblind users (#4807)
This commit is contained in:
parent
1a30edc55f
commit
01f7b1c9a6
@ -4,6 +4,7 @@ import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
@ -134,7 +135,19 @@ public class OverdriveProjector extends Block{
|
||||
Draw.rect(topRegion, x, y);
|
||||
Draw.alpha(1f);
|
||||
Lines.stroke((2f * f + 0.1f) * heat);
|
||||
Lines.square(x, y, Math.min(1f + (1f - f) * size * tilesize / 2f, size * tilesize/2f));
|
||||
//float hype = 1.414f * size * tilesize / 2f; // hypotenuse
|
||||
float r = Math.max(0f, Mathf.clamp(2f - f * 2f) * size * tilesize / 2f - f - 0.2f);
|
||||
float w = Mathf.clamp(0.5f - f) * size * tilesize;
|
||||
Lines.beginLine();
|
||||
for(int i = 0; i < 4; i++){
|
||||
Lines.linePoint(x + Geometry.d4(i).x * r + Geometry.d4(i).y * w, y + Geometry.d4(i).y * r - Geometry.d4(i).x * w);
|
||||
if(f < 0.5f) Lines.linePoint(x + Geometry.d4(i).x * r - Geometry.d4(i).y * w, y + Geometry.d4(i).y * r + Geometry.d4(i).x * w);
|
||||
|
||||
//Lines.lineAngleCenter(x + Geometry.d8edge(i).x * size * tilesize / 2f * (1f - f), y + Geometry.d8edge(i).y * size * tilesize / 2f * (1f - f), 135f + 90f * i, hype * (0.5f - Math.abs(f - 0.5f)) * 2f);
|
||||
//if(f < 0.5f) Lines.lineAngleCenter(x + Geometry.d4(i).x * size * tilesize / 2f - Geometry.d4(i).x * f, y + Geometry.d4(i).y * size * tilesize / 2f - Geometry.d4(i).y * f, 90f + 90f * i, (0.5f - f) * 2f * size * tilesize);
|
||||
}
|
||||
Lines.endLine(true);
|
||||
//Lines.square(x, y, Math.min(1f + (1f - f) * size * tilesize / 2f, size * tilesize/2f));
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user