LibGdx Screens and stages

What are the main differences and how to i use them. I´m following a tutorial that uses screens as the base. Now i would like to add Touchpad to the screen, but it requires stage.

Do i need to recode the game into using stages as base? If yes, can someone give me a tutorial that does that, so far i have only found game tutorials that extends Game and uses screens.

Is there a way to combine stages and screens, so that i don´t have to rewrite the game, instead i just add stage to the screen and add Touchpad to the stage then. If yes, then what would be the way to go to do this?

I dont think you have to change much. im doing it like this:


public abstract class AbstractScreen implements Screen {
    protected final MyGdxGame game;
    protected final BitmapFont font;
    protected final SpriteBatch batch;
    protected final Stage stage;

    public AbstractScreen(MyGdxGame game){
        this.game = game;
        this.font = new BitmapFont();
        this.batch = new SpriteBatch();
        this.stage = new Stage(new ScreenViewport());
    }
.
.

How do you handle the rendering of the objects that are on the screen and object that are on the stage at the same time ?

I’m not entirely sure how it all fits together but I had to use stage.getBatch().draw(), because batch.draw() wasn’t drawing anything.

also I have this in my AbstractScreen render method


        stage.act( delta );
        stage.draw();

Anyway to split my screen? i have a 272x408 screen. in it the playfield is 136X204. I want to add a hud, where the controls and stats are, to the bottom of the screen. SO that the HUD part is fully stage and the playfield is screen. but i cant hit the sweetspot with the resolution. the Hud should be 75 high. so the screenspace for the playfield is 272X333 But when i take the aspect ratio and try to but it on the playfield measurements, it just doesent fit anymore. objects stretch and borders go wrong.

public GameScreen(){
		float screenWidth = Gdx.graphics.getWidth();
        float screenHeight = Gdx.graphics.getHeight();
        float gameWidth = GameConstants.GAMEWIDTH;
        float gameHeight = (screenHeight / (screenWidth / gameWidth));
        int midPointX = (int) (gameWidth/2);
        
        touchpadSkin = new Skin();
        touchpadSkin.add("Backround", new Texture("data/backround.png"));
        touchpadSkin.add("knob", new Texture("data/knob.png"));
        touchpadStyle = new TouchpadStyle();
        touchBackround = touchpadSkin.getDrawable("Backround");
        touchKnob = touchpadSkin.getDrawable("knob");
        touchpadStyle.background = touchBackround;
        touchpadStyle.knob = touchKnob;
        touchpad = new Touchpad(5, touchpadStyle);
        touchpad.setBounds(0, 0, 75, 75);
        
        stage = new Stage(Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
        stage.addActor(touchpad);
		
        world = new GameWorld(midPointX, touchpad);
		renderer = new GameRenderer(world,(int)gameHeight);
		
		//Gdx.input.setInputProcessor(new InputHandler(world.getPlayer()));
		Gdx.input.setInputProcessor(stage);
	}