I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library.
I would like the background and objects (images and graphic shapes) to adjust to fit the screen size whenever the display size changes.
This is how the state looks by default. I can change the screen size, but the objects do not.
appGameContainer = new AppGameContainer(
new ScalableGame(new AppStateController(), Settings.video.getWidth(), Settings.video.getHeight(), true)
);
appGameContainer.setDisplayMode(Settings.video.getWidth(), Settings.video.getHeight(), Settings.video.isFullScreen());
appGameContainer.start();
If I add a value of 100 to the width and height in the ScalableGame constructor call, the state looks like this:
appGameContainer = new AppGameContainer(
new ScalableGame(new AppStateController(), Settings.video.getWidth() + 100, Settings.video.getHeight() + 100, true)
);
appGameContainer.setDisplayMode(Settings.video.getWidth(), Settings.video.getHeight(), Settings.video.isFullScreen());
appGameContainer.start();
If I add a value of 100 to the width and height of the display, the state looks like this:
appGameContainer = new AppGameContainer(
new ScalableGame(new AppStateController(), Settings.video.getWidth(), Settings.video.getHeight(), true)
);
appGameContainer.setDisplayMode(Settings.video.getWidth() + 100, Settings.video.getHeight() + 100, Settings.video.isFullScreen());
appGameContainer.start();
Here are some more screenshots that demonstrate the problem:
Do you know what might be causing the problem?