I’m quite new to MonoGame/XNA and I’m currently trying to create a pong clone. I’m creating the main menu and I’m trying to get the title of the main menu to centre in the middle of a 800x600 resolution window but it doesn’t seem to centre correctly.
This is my code for creating the title text (I created my own Text object) title = new Text(font, "Pong", new Vector2(400, 100), Color.White);
An x position of 400 should be in the middle of the window but instead it’s placed like this:
The position you specify is the top left corner of your text. You can use SpriteFont.MeasureString to check the length of your text and offset it appropriately so it gets centered.