I’m drawing a tile-based game. Some tiles can rotate, about their centre. It appears that setting a rotation origin for one SpriteBatch.Draw call effects all other Draw calls with no origin specified.
Is there a way to avoid having to speficy the origin for every other draw call for non-rotating tiles?
Ideally i don’t want to have to batch drawing my non-rotating tiles together and draw before/seperately to my rotating tiles.
This is simply not the case. The
originforDrawapplies only to that particularDraw.If you are using an overload of
Drawthat does not specify an origin, an origin ofVector2.Zerois implicitly used.Now, if you are actually passing a matrix to
Begin, that matrix will be applied to allDrawcalls (including ones where you set an origin) on that particular sprite batch until itsEndmethod is called.You should use the rotation parameter of
Drawto rotate individual sprites in your world. You should use the matrix parameter onBeginto move the view of all of your sprites around (like a camera).