package com.ychstudio.screens.transitions;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Interpolation;

public class SlideLeftTransition implements ScreenTransition {
    
    private float duration;
    
    public SlideLeftTransition(float duration) {
        this.duration = duration;
    }

    @Override
    public float getDuration() {
        return duration;
    }

    @Override
    public void rander(SpriteBatch batch, Texture currentScreenTexture, Texture nextScreenTexture, float alpha) {
        float w = Gdx.graphics.getWidth();
        alpha = Interpolation.fade.apply(alpha);
        
        Sprite currentSprite = new Sprite(currentScreenTexture);
        currentSprite.flip(false, true);
        currentSprite.setPosition(w * alpha, 0);
        Sprite nextSprite = new Sprite(nextScreenTexture);
        nextSprite.flip(false, true);
        nextSprite.setPosition(-w + w * alpha, 0);
        
        batch.begin();
        currentSprite.draw(batch);
        nextSprite.draw(batch);
        batch.end();
    }

}

@@ -112,53 +112,8 @@
 re;%0A
-import com.badlogic.gdx.graphics.g2d.Sprite;%0A
 impo
@@ -714,399 +714,324 @@
     
-Sprite currentSprite = new Sprite(currentScreenTexture);%0A        currentSprite.flip(false, true);%0A        currentSprite.setPosition(w * alpha, 0);%0A        Sprite nextSprite = new Sprite(nextScreenTexture);%0A        nextSprite.flip(false, true);%0A        nextSprite.setPosition(-w + w * alpha, 0);%0A        %0A        batch.begin();%0A        currentSprite.draw(batch);%0A        nextSprite.draw(batch
+batch.begin();%0A        batch.draw(currentScreenTexture, w * alpha, 0, w, currentScreenTexture.getHeight(), 0, 0, (int)w, currentScreenTexture.getHeight(), false, true);%0A        batch.draw(nextScreenTexture, -w + w * alpha, 0, w, nextScreenTexture.getHeight(), 0, 0, (int)w, nextScreenTexture.getHeight(), false, true
 );%0A 

Improve transition by using batch.draw directly without creating Sprites