That's weird, whenever I've created a title it automatically centers. I don't recognize the sf::Style::Titlebar when I created my window the last parameter was the title, I didn't add anything else. Do you know if that parameter has anything to do with it?
Twiggy the sf::Style::Titlebar is only used if you want to change it from default. the default is: resize, titlebar, close. when i only wrote titlebar it got rid of the ability to resize and close the window using the close button.
Well, that's odd, were you trying to change the options? the way I've always done it is _mainWindow.create(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32), "Game Name"); the 32 in there is for depth, which I didn't use anyway, but this is the way the tutorial told me to render the window so I did. I tried your code and the title shows up in the center, Duoas was right, not that I doubted. but yea the buttons to minimize, maximize, and close buttons were gone. What os are you using?
oh.... well I'm honestly not sure how to fix it and apparently its not an option in windows 8, do a google search on centering the title bar in windows 7, other than that I don't know why it would be not centered, like I said I ran your code and it was in the center on my pc
One thing I thought of to ask was, is all the rest of your titles on the title bar centered? like on file explorer or other programs? because if they are then I don't know what is going on. If they all on the side then hopefully you can find a solution on Google (or have you?)
Duoas has already explained the issue at hand. The positioning of the text in the titlebar is controlled by the OS, so to set it manually you would either need to do some OS-specific work or don't have the OS draw it at all and draw one yourself manually.