2
votes

I'm currently working on a game and I'm trying to implement a color key collision. I followed the road not taken tutorial, and worked until the point of getting the texture from the render target, which is unavailable in XNA 4 and I don't seem to find an equivalent? Any help :D

Thanks in advance !!

1

1 Answers

8
votes

In XNA 4.0 the RenderTarget2D class inherits from Texture2D, which means that you can simply cast your render target to a texture:

Texture2D texture = (Texture2D)renderTarget;