-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Center in game window at the start of the program. #1694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
from #1122 "You can position windows using SetNextWindowPos(). You can disable window moving, and within a window use SetCursorScreenPos() to position the next widgets. Please read on imgui_demo.cpp, execute the demo app and read imgui.h to find details." or you can manually edit the imgui.ini file |
This is not the problem... |
Hello @DasOhmoff, thanks for reporting this. Looks like something broke since I introduced this feature (in this situation the positioning is applied before the window had a chance to calculate its own size). Will look into it.. (PS 1: you are using an old version, |
Thank you my friend :) . |
…fixes SetNextWindowPos() given a non-zero pivot. (#1694)
This is an unusually complex/tricky matter, so although I have no pushed a fix which I believe will fix your issue, it probably has subtle side effects on other uses and I expect to return to it at some point. For now I believe your issue is fixed if you grab latest. FYI I believe Repro
|
Hello, first of all I just want to mention that this is a great library and that I really like it :)
That being said, I have a little problem, I would like to know how to set the window position automatically to the middle of the screen on the start of the program.
My code:
The problem is that

ImGuiCond_Once
does not seem to work as I though it would. Here is my screen when I open the test window in the program for the first time:After I close the test window in the program and reopen it, it works just how it is supposed to work.

So basically to center the test window, I have to close and reopen it.
How do I set the test window position to the center without having to close and reopen it?
The text was updated successfully, but these errors were encountered: