Versatile Java game engine with pluggable backends (this was used in Rogue, I think)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
824 B

10 years ago
package mightypork.gamecore.core.plugins.screenshot;
import mightypork.gamecore.core.App;
import mightypork.gamecore.core.events.MainLoopRequest;
import mightypork.gamecore.core.plugins.AppPlugin;
10 years ago
import mightypork.utils.Support;
/**
* This plugin waits for a {@link ScreenshotRequest} event.<br>
* Upon receiving it, a screenshot is captured and written to file
* asynchronously.
*
10 years ago
* @author Ondřej Hruška (MightyPork)
*/
10 years ago
public class ScreenshotPlugin extends AppPlugin implements ScreenshotRequestListener {
10 years ago
/**
* Take screenshot. Called by the trigger event.
*/
10 years ago
@Override
public void onScreenshotRequest()
10 years ago
{
App.bus().send(new MainLoopRequest(new Runnable() {
10 years ago
@Override
public void run()
{
final Runnable tts = new TaskTakeScreenshot();
10 years ago
Support.runAsThread(tts);
}
}));
}
}