0

Hey guys I was wondering if there was a way to make slick2d resizable by the user.(I have researched this and only found out how to make the program resizable within the program)

Here is my code and thanks in advance.

package Main;
import States.Menu;
import States.Play;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;

/**
 *
 * @author Kyle
 */
public class Lawu extends StateBasedGame{

    public static final String gamename = "Lawu";
    public static final int menu = 0;
    public static final int play = 1;

    public static int height=600,width=760;

    public Lawu(String gamename)
    {
        super(gamename);
        this.addState(new Menu(menu));
        this.addState(new Play(play));
    }

    public static void main(String[] args) {
        AppGameContainer appgc;
        try{
            appgc = new AppGameContainer(new Lawu(gamename),width, height, false);
            appgc.start();
        }
        catch(SlickException e)
        {
            e.printStackTrace();
        }
    }

    public void initStatesList(GameContainer gc) throws SlickException {
        this.getState(menu).init(gc, this);
        this.getState(play).init(gc, this);
        gc.setIcon("res/Monster.png");
        this.enterState(menu);
    }
}
me me
  • 778
  • 2
  • 7
  • 18
  • have you checked the docs for anything useful? http://slick.cokeandcode.com/javadoc/org/newdawn/slick/AppGameContainer.html I see only the Frame component has a setResizable(boolean b) method – David Kroukamp Jun 15 '12 at 14:58

2 Answers2

0

Put this before appgc.start():

appgc.setResizable(true);
HUNeater
  • 166
  • 3
  • 16
0

You have to use display.setResizable(boolean).

spongebob
  • 8,370
  • 15
  • 50
  • 83