I want my game to have screenshot functionality from the pause menu, so I decided to use ScreenshotAppState to do just that. However, it doesn’t seem to be working.
I put this code inside a loop that checks if the screenshot button is pressed:
ScreenshotAppState screenShotState = new ScreenshotAppState();
this.stateManager.attach(screenShotState);
screenShotState.onAction(null,true,0);
However, nothing happens. I quit and refresh my file system, but nothing shows up. I also made sure that the code was being reached. So why won’t this work? Am I implementing it wrong? Is it because I’m attaching the state on the same frame as when I print?