[SOLVED] 2D matrices?

Hey, I have a really basic question connected to 2D development.

I’m used to 3D dev in MonoGame, where the position of objects in space is set up using the World matrix. Now I’m making my first 2D game, and I’m actually puzzled as to how the above is done in 2D.

The position of sprites on the screen is set up using the SpriteBatch class, but that sets only the position of the sprite which is being drawn, and is, as I understand, relative to viewport. Am I right in thinking that some sort of 2D World martix must be implemented to set the absolute position of objects in the game?

You can just use a vector2 for position and optionally a vector2 for scale and a float for rotation. That’s how you pass things to spritebatch which afaik most people use for their 2D drawing, so it also makes sense to store it that way. Just adjust for camera position if you need to. If you want to support skewing too, I believe Nez has a custom spritebatch that supports it.

Ah, that is a lot simpler than I expected. Sorry if this question was stupid :wink: I guess it just feels odd not to use matrices if you’ve only done 3D dev before…