0 scroll support

This commit is contained in:
Anuken
2021-09-17 21:32:43 -04:00
parent cdb12a381d
commit 5d5d1f8953
2 changed files with 7 additions and 2 deletions

View File

@@ -355,7 +355,12 @@ public class Renderer implements ApplicationListener{
Tmp.tr1.u2 = size;
Tmp.tr1.v2 = size / ratio;
float sx = (camera.position.x) / state.rules.backgroundSpeed, sy = (camera.position.y) / state.rules.backgroundSpeed;
float sx = 0f, sy = 0f;
if(!Mathf.zero(state.rules.backgroundSpeed)){
sx = (camera.position.x) / state.rules.backgroundSpeed;
sy = (camera.position.y) / state.rules.backgroundSpeed;
}
Tmp.tr1.scroll(sx + state.rules.backgroundOffsetX, -sy + state.rules.backgroundOffsetY);

View File

@@ -126,7 +126,7 @@ public class Rules{
public @Nullable String customBackgroundCallback;
/** path to background texture with extension (e.g. "sprites/space.png")*/
public @Nullable String backgroundTexture;
/** background texture move speed scaling - bigger numbers mean slower movement */
/** background texture move speed scaling - bigger numbers mean slower movement. 0 to disable. */
public float backgroundSpeed = 27000f;
/** background texture scaling factor */
public float backgroundScl = 1f;