Drawing Transparency in XNA 4.0

Posted by dpaz on Game Development See other posts from Game Development or by dpaz
Published on 2013-07-10T01:46:11Z Indexed on 2013/10/19 4:15 UTC
Read the original article Hit count: 173

Filed under:
|
|

Using C# (VS2010) with XNA 4.0, I have a terrain layer (RenderTarget2D) in a 2D side-scroller. My visual system tracks updates to redraw individual tiles, but I am having trouble finding a way to clear out the rectangle where the tile will be drawn, which I must do because A) there may no longer be a tile or B) the tile may itself contain transparency.

How can I draw a rectangle of transparency onto an existing RenderTarget2D? I essentially want to clear just that rectangular portion of it.

My Google searches have not yielded anything relevant.

© Game Development or respective owner

Related posts about XNA

Related posts about c#