Hi guys, I’m totally stuck! I’m using Slick2d in my game and during development I’ve mostly been working with the game windowed.
In my main() method I have this line:
game.setDisplayMode(800, 500, false);
Which looks like this:
When I change that to:
game.setDisplayMode(1440, 900, true);
But doing this makes the game look like this (the Quit button is approx. twice the size of the windowed version), the frame rate counter isn’t visible either which make me think that it’s somehow zooming in to the bottom right corner:
The “buttons” on the screen are defined and drawn like so:
public void render(GUIContext container, Graphics graphics) throws SlickException {
Color c = graphics.getColor();
graphics.setColor(Color.white);
graphics.draw(this.box);
if (this.isMouseOver) {
graphics.setColor(new Color(135, 206, 235));
}
graphics.drawString(this.t, this.getX()+5, this.getY()+5);
graphics.setColor(c);
this.box is a Rectangle object, this.t is a String with the text to display, this.x/y are meant to be pixel co-ords to draw the button. This class extends AbstractComponent from Slick2d, only for the sake of using the render() method.
I’ve searched high and low for anything that could be calling a scale() method or something like that but I can’t find anything.
Does anyone have any suggestions as to what could be causing this strange behaviour? Thanks
EDIT: I’ve tested in various resolutions and it seems that it’s when the game runs in FULL SCREEN that this scaling occurs, and it seems to be making the quit button the same size in inches on my monitor in each resolution.