spinSprite

This commit is contained in:
Sunny Kim
2021-07-19 16:36:58 +09:00
committed by GitHub
parent 1674b2dfd6
commit 2583541c0f

View File

@@ -274,4 +274,13 @@ public class Drawf{
Draw.reset();
}
/** Draws a sprite that should be lightwise correct. Provided sprite must be symmetrical. */
public static void spinSprite(TextureRegion region, float x, float y, float r){
r = Mathf.mod(r, 90f);
Draw.rect(region, x, y, r);
Draw.alpha(r / 90f);
Draw.rect(region, x, y, r - 90f);
Draw.alpha(1f);
}
}