I’m looking to make a security camera type feature in a game I want to design. The idea that I have is that there will be a designated rectangle similar to a TV screen in the game and I want to be able to display in that rectangle area what a Camera sees in a specific room.
So to setup a specific scenario, let’s say we have Room A and Room B. I want in Room B to be a TV Screen that displays what is currently shown in Room A. I know this must be possible some how using the XNA camera functions, I’m just really unsure how I would output what the camera sees in that area and then show it in the designated sprite rectangle in Room B.
Hopefully this makes sense or is possible 😀
TKs,
Shane.
You will want to render your security camera scene to a custom
RenderTarget2D, which you can then use as though it were aTexture2D.The 5 basic steps to this are:
RenderTarget2DGraphicsDeviceto render to this new targetFor more information, see Riemer’s XNA tutorial.