make static accessible width & height

This commit is contained in:
yugecin 2016-09-27 18:36:35 +02:00
parent b1894ade26
commit c64e0252aa

View File

@ -41,6 +41,8 @@ public class Container extends AppGameContainer {
protected SlickException e = null; protected SlickException e = null;
public static Container instance; public static Container instance;
public static int width;
public static int height;
/** /**
* Create a new container wrapping a game * Create a new container wrapping a game
@ -51,20 +53,8 @@ public class Container extends AppGameContainer {
public Container(Game game) throws SlickException { public Container(Game game) throws SlickException {
super(game); super(game);
instance = this; instance = this;
} width = this.getWidth();
height = this.getHeight();
/**
* Create a new container wrapping a game
*
* @param game The game to be wrapped
* @param width The width of the display required
* @param height The height of the display required
* @param fullscreen True if we want fullscreen mode
* @throws SlickException Indicates a failure to initialise the display
*/
public Container(Game game, int width, int height, boolean fullscreen) throws SlickException {
super(game, width, height, fullscreen);
instance = this;
} }
@Override @Override