Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I go about using clipping in Slick2D? I want to have an infinitely large world, however I'm not very good with clipping and it's my only problem. I don't have anything drawn outside of the rectangle that the rectangle can move to, and it's bothersome.

share|improve this question
Your question is really confusing. What do you mean by rectangle? Do you mean your window? And why would you want anything rendered outside the range of what's visible on your window? – Fault Feb 7 '12 at 2:16

As Fault says, the question is a bit confusing. If you're looking for how to clip a large image like a background(which I'll assume is an Image), you could clip it using one of the draw functions.

//From the javadoc:
//Draw a section of this image at a particular location and scale on the screen
//clipx and clipy are the top left corner of the clipped image
//clipx2 and clipy2 are bottom left corner
background.draw(x, y, clipx, clipy, clipx2, clipy2);
share|improve this answer

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.