Drawf.Laser with different ends (#5301)
* Laser with different ends * Allow usage of different ended TractorBeamTurret lasers * oops * aaaa * too. many. commits. * Remove rotation * I shouldn't be allowed to edit from the browser.
This commit is contained in:
@@ -204,20 +204,24 @@ public class Drawf{
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float scale){
|
||||
laser(team, line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale);
|
||||
}
|
||||
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2){
|
||||
laser(team, line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), 1f);
|
||||
laser(team, line, edge, edge, x, y, x2, y2, 1f);
|
||||
}
|
||||
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float rotation, float scale){
|
||||
float scl = 8f * scale * Draw.scl;
|
||||
float vx = Mathf.cosDeg(rotation) * scl, vy = Mathf.sinDeg(rotation) * scl;
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion start, TextureRegion end, float x, float y, float x2, float y2){
|
||||
laser(team, line, start, end, x, y, x2, y2, 1f);
|
||||
}
|
||||
|
||||
Draw.rect(edge, x, y, edge.width * scale * Draw.scl, edge.height * scale * Draw.scl, rotation + 180);
|
||||
Draw.rect(edge, x2, y2, edge.width * scale * Draw.scl, edge.height * scale * Draw.scl, rotation);
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float scale){
|
||||
laser(team, line, edge, edge, x, y, x2, y2, scale);
|
||||
}
|
||||
|
||||
public static void laser(Team team, TextureRegion line, TextureRegion start, TextureRegion end, float x, float y, float x2, float y2, float scale){
|
||||
float scl = 8f * scale * Draw.scl, rot = Mathf.angle(x2 - x, y2 - y);
|
||||
float vx = Mathf.cosDeg(rot) * scl, vy = Mathf.sinDeg(rot) * scl;
|
||||
|
||||
Draw.rect(start, x, y, start.width * scale * Draw.scl, start.height * scale * Draw.scl, rot + 180);
|
||||
Draw.rect(end, x2, y2, end.width * scale * Draw.scl, end.height * scale * Draw.scl, rot);
|
||||
|
||||
Lines.stroke(12f * scale);
|
||||
Lines.line(line, x + vx, y + vy, x2 - vx, y2 - vy, false);
|
||||
|
||||
Reference in New Issue
Block a user