Reputation: 379
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 :D
TKs, Shane.
Upvotes: 1
Views: 99
Reputation: 44374
You will want to render your security camera scene to a custom RenderTarget2D
, which you can then use as though it were a Texture2D
.
The 5 basic steps to this are:
RenderTarget2D
GraphicsDevice
to render to this new targetFor more information, see Riemer's XNA tutorial.
Upvotes: 2