Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.newdawn.slick.CanvasGameContainer;
- import org.newdawn.slick.Game;
- import org.newdawn.slick.ScalableGame;
- import org.newdawn.slick.SlickException;
- /**
- * A wrapper equal to the {@link ScalableGame} container but with resize feature. This means you can resize the window
- * of the game and let this container handle the adjustments. The container can be used like the
- * {@link CanvasGameContainer}. It's a canvas which can be added to a panel.
- *
- * @author Stefan Lange
- * @version 1.0.0
- * @since 15.01.2012
- */
- public class AutoScalableGame extends CanvasGameContainer {
- private static final long serialVersionUID = -5755115975328286634L;
- /**
- * Create a new auto scalable game wrapper.
- *
- * @param game
- * The game to be wrapper and displayed at a different resolution
- * @param normalWidth
- * The normal width of the game
- * @param normalHeight
- * The normal height of the game
- * @param maintainAspect
- * True if we should maintain the aspect ratio
- * @throws SlickException
- */
- public AutoScalableGame(Game game, int normalWidth, int normalHeight, boolean maintainAspect) throws SlickException {
- this(game, false, normalWidth, normalHeight, maintainAspect);
- }
- /**
- * Create a new auto scalable game wrapper.
- *
- * @param game
- * The game to be wrapper and displayed at a different resolution
- * @param shared
- * True if shared GL context should be enabled. This allows multiple panels
- * @param normalWidth
- * The normal width of the game
- * @param normalHeight
- * The normal height of the game
- * @param maintainAspect
- * True if we should maintain the aspect ratio
- * @throws SlickException
- */
- public AutoScalableGame(Game game, boolean shared, int normalWidth, int normalHeight, boolean maintainAspect) throws SlickException {
- super(new ScalableGame(game, normalWidth, normalHeight, maintainAspect), shared);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement