Closed damntourists closed 4 months ago
could you please put some more code also does it work with C++ Dear ImGui?
Sure, here's where I was using it:
func AddSceneModal() {
if AddSceneModalOpened {
imgui.OpenPopupStr(AddSceneModalTitle)
}
flags := imgui.WindowFlagsNoMove |
imgui.WindowFlagsNoSavedSettings |
imgui.WindowFlagsAlwaysAutoResize
// No matter what color I use, it doesn't show up.
// Even the default color is not present.
imgui.PushStyleColorVec4(imgui.ColModalWindowDimBg,
imgui.Vec4{0.8, 0.8, 0.8, 0.8})
var inputName string
if imgui.BeginPopupModalV(AddSceneModalTitle, nil, imgui.WindowFlags(flags)) {
imgui.SetKeyboardFocusHere()
if imgui.InputTextWithHint("##AddSceneNameInput", "Name", &inputName,
imgui.InputTextFlagsEnterReturnsTrue, nil) {
// TODO
AddSceneModalOpened = false
imgui.CloseCurrentPopup()
}
if imgui.Button("Close") {
imgui.CloseCurrentPopup()
AddSceneModalOpened = false
}
imgui.EndPopup()
}
imgui.PopStyleColor()
}
I have not tried this in C++ since it's not a language I'm too familiar with yet. I'll give it a shot in a bit to see if I can replicate in C++ though.
It's an issue within imgui itself that you could only set it globally (https://github.com/ocornut/imgui/issues/7340)
It's fixed in 1.90.4
Awesome, thanks for updating this thread! I'll close it out.
I'm finding that I'm unable to set the color/alpha of the overlay for modal windows. Is this a known issue?