If you use a textured quad, you have some additional flexibility over the geometry that you wouldn't have with a SpriteBatch
. This will allow you to implement the skewing you're after. You can then implement the skew:
Pinch the top two vertices in on the X axis (or push the bottom two vertices out along the same axis). That is, create a quad with corner points at, say, (-0.5, 1.0f), (0.5, 1.0), (1.0, -1.0), (-1.0, -1.0). This is the approach you'd have to take if you are using an orthographic projection elsewhere.
Push the top two vertices away from the camera along the Z axis (give them Z coordinates of, say, 0.5 if the rest of your quad is in the Z = 0.0 plane). If you use a perspective projection, this will achieve the skew naturally.
Both options will potentially have slightly different results in terms of the appearance of the texture mapped to the quad, and both approaches are more appropriate for certain kinds of existing rendering pipelines (primarily based around the projection matrix you are currently using). You'll have to pick the one that best fits your code and your desired visual style.
Note that abandoning SpriteBatch
means you lose some of the batching optimizations it makes for you, which you may need to re-implement depending on the overall performance (and performance bar) of your game.
(Also note that a third option would be to just author the sprite textures with the desired perspective distortion built-in, which means you can simply continue to use SpriteBatch
, but adjusting the perspective would be difficult as it would require re-authoring your sprites.)