문제

I'm making a simple side scroller game in Java but am having trouble making the camera move with the person. My plan was to create a buffered image that could adjust the region of the image that is displaying and simply have it follow my character. However, I couldn't find any functions in the API to change the region of the buffered image that's displayed, so how could I do this? Thanks for any help provided.

 //The level is created in an 800x400 pixel size, is there any way I can change
 //the region myImage displays?
myImage =  new BufferedImage(400, 400, BufferedImage.TYPE_INT_RGB);
도움이 되었습니까?

해결책

Well while you will be drawing your image you have a lot of options for example this function can draw any rectangle from your original image on any rectangle of the surface you get Graphics object from.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top