MatthiasM wrote:
Hmm strange - maybe you need to call GUI.clearKeyboardState() and clearMouseState() ?
I tried this but the panel still stays open.
MatthiasM wrote:
Can you post the code (hopefully in a way that I can run it) ?
I will have to write up a self contained program for you...I am running in Slick right now and need to extract the code.
But in the mean time, this is the method I have that actually changes the resolution and syncs the view port:
tswGame is a TWLStateBasedGame.
Code:
public static void changeResolution ()
{
try
{
AppGameContainer app = (AppGameContainer)tswGame.getContainer();
app.setDisplayMode(resolution.getDimension().getX(), resolution.getDimension().getY(), VideoSettings.isFullScreen());
//Update the renderer to sync with the new display.
tswGame.getRenderer().syncViewportSize();
}
catch (SlickException e)
{
e.printStackTrace();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
And the Combobox code...
Code:
resolutionComboBox.addCallback(new Runnable(){
@Override
public void run ()
{
int index = resolutionComboBox.getSelected();
ResolutionEntry newResolution = resolutionComboBox.getModel().getEntry(index);
VideoSettings.setResolution(newResolution);
VideoSettings.changeResolution();
VideoSettings.saveSettings();
//After this the popup is still there...
}
});
I will put something together and reply to this thread today or tomorrow.
Thanks!