0 scroll support
This commit is contained in:
@@ -355,7 +355,12 @@ public class Renderer implements ApplicationListener{
|
|||||||
Tmp.tr1.u2 = size;
|
Tmp.tr1.u2 = size;
|
||||||
Tmp.tr1.v2 = size / ratio;
|
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);
|
Tmp.tr1.scroll(sx + state.rules.backgroundOffsetX, -sy + state.rules.backgroundOffsetY);
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class Rules{
|
|||||||
public @Nullable String customBackgroundCallback;
|
public @Nullable String customBackgroundCallback;
|
||||||
/** path to background texture with extension (e.g. "sprites/space.png")*/
|
/** path to background texture with extension (e.g. "sprites/space.png")*/
|
||||||
public @Nullable String backgroundTexture;
|
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;
|
public float backgroundSpeed = 27000f;
|
||||||
/** background texture scaling factor */
|
/** background texture scaling factor */
|
||||||
public float backgroundScl = 1f;
|
public float backgroundScl = 1f;
|
||||||
|
|||||||
Reference in New Issue
Block a user