Simply get the SFGUI window size using GetAllocation, the sfml window size using getSize, then do this arithmetic:
auto window = sfg::Window::Create();
auto win_rect = window->GetAllocation();
sf::Vector2f size(win_rect.width, win_rect.height);
window->SetPosition(((sf::Vector2f)rwindow->getSize() - size) / 2.0f);
Comments