0

I am working on a game where the main screen in on one camera. What i want is to have a small box on the screen working as a monitor or a picture-in-picture showing another area.

How can i set the second camera(the PIP one) to be contained in a square? Do i need to cut what are on the sides myself or there is a way the camera can handle it?

Danfus
  • 13
  • 1
  • You don't need to cut things yourself. You just need to render twice. First render the scene using the PIP camera to a rendertarget2d (which is pretty much rendering to a texture instead of to the backbuffer). Then render the scene to the backbuffer using the main camera. Finally draw the rendertarget2d as a texture to the backbuffer where you want it, eg the top right corner. – Weyland Yutani May 20 '14 at 14:10
  • I'm still learning and can't think this way... :( This works great ty. – Danfus May 20 '14 at 14:44
  • 1
    I don't think this question has anything to do with Farseer. – craftworkgames May 21 '14 at 03:49
  • @craftworkgames You're partially right. This isn't necessarily related to Farseer, however I believe that OP got his Camera class from the Farseer examples. Hence, the tag. – Falgantil May 21 '14 at 13:26
  • @Bjarke Søgaard Yes, you are right. – Danfus May 21 '14 at 15:53
  • @Danfus Figured. You should know, that while you did get the camera class from the Farseer examples, the problem you're facing is related to all 2D cameras in general. – Falgantil May 22 '14 at 09:17

0 Answers0