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.

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
2  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.