Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I released my game for testing for both windows and mac. I'm using mac as my development workspace. My friends uses windows and the window was to big. I created a 1000*1500 Screen window. I can change the window size but that means I have to re-do all my sprite sheets again with smaller sheets. I don't want to this again but is there a way which I can make the window smaller without changing the size of my sprite and changing co-ordinates of the mouse clicks?

share|improve this question
Scale the graphics context. If your reference resolution is AxB and you want to change the resolution to something like (A*rX)x(B*rY), you will need to scale by rX on X and rY on Y. –  nathan Nov 21 '12 at 8:58
` try{ AppGameContainer app =new AppGameContainer(new Game(gamename)); app.setDisplayMode(1500, 1000, false); app.start(); app.setShowFPS(false) ; app.setVSync(true); }catch(SlickException e){ e.printStackTrace(); }` This is my code for my screen –  SystemNetworks Nov 21 '12 at 9:58
Please, please please... why are you pasting code? I know of to create a window with a given size in Slick2D :) The solution to achieve what you want has been explained in my previous comment. Don't except me to write a full answer with the piece of code you are expecting that would do the trick out of the box. You never accept answer anyway and do not put any effort on researching etc. –  nathan Nov 21 '12 at 10:05
I did research. But the codes I don't understand so I its much better asking than reading things I don't understand. –  SystemNetworks Nov 23 '12 at 2:51
Really i don't except answers? Answers are suppose to be put into effort, to let the asker know what you mean. For example, if I'm a new java developer and I know only the basics, How would you explain and answers? The answers are not put into effort(most) I will accept it. –  SystemNetworks Nov 23 '12 at 2:55

1 Answer 1

Use a ScaleableGame like this:

AppGameContainer agc = new AppGameContainer(
            new ScalableGame(INSERT YOUR GAME INSTANCE HERE,1000,1500));

Where W and H are the width and height of the actual window. Using this method your app will think that it is running at 1000x1500, but it will actually be running at WxH. All graphics output and mouse input etc. will be scaled accordingly, so you just program as if it is 1000x1500. Couldn't be simpler when you know how, eh?

share|improve this answer
I have done that before already. I have fixed my question. –  SystemNetworks Feb 2 '13 at 5:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.