DrawRegion spinSprite
This commit is contained in:
Binary file not shown.
@@ -5,12 +5,14 @@ import arc.graphics.g2d.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.graphics.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawRegion extends DrawBlock{
|
public class DrawRegion extends DrawBlock{
|
||||||
public TextureRegion region;
|
public TextureRegion region;
|
||||||
public String suffix = "";
|
public String suffix = "";
|
||||||
|
public boolean spinSprite = false;
|
||||||
public float rotateSpeed, x, y;
|
public float rotateSpeed, x, y;
|
||||||
/** Any number <=0 disables layer changes. */
|
/** Any number <=0 disables layer changes. */
|
||||||
public float layer = -1;
|
public float layer = -1;
|
||||||
@@ -26,7 +28,11 @@ public class DrawRegion extends DrawBlock{
|
|||||||
public void drawBase(Building build){
|
public void drawBase(Building build){
|
||||||
float z = Draw.z();
|
float z = Draw.z();
|
||||||
if(layer > 0) Draw.z(layer);
|
if(layer > 0) Draw.z(layer);
|
||||||
Draw.rect(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed);
|
if(spinSprite){
|
||||||
|
Drawf.spinSprite(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed);
|
||||||
|
}else{
|
||||||
|
Draw.rect(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed);
|
||||||
|
}
|
||||||
Draw.z(z);
|
Draw.z(z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -24,4 +24,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=916c5a77
|
archash=e98a7f21
|
||||||
|
|||||||
Reference in New Issue
Block a user