SpaiR / imgui-java

JNI based binding for Dear ImGui
MIT License
547 stars 90 forks source link

Unable to assign / use custom ImGuiStyle #194

Open rheia777 opened 11 months ago

rheia777 commented 11 months ago

I wanted to set a custom style, but I can't seem to find the correct method to use. Usually you just get a pointer to the object and edit that. Do you have to assign it somewhere else, when using these bindings?

Example code:

ImGuiStyle style = ImGui.getStyle();
style.setAlpha(1.0f);
style.setDisabledAlpha(0.6000000238418579f);
style.setWindowPadding(8.0f, 8.0f);
style.getColors()[ImGuiCol.WindowBg] = new float[] {0.09803921729326248f, 0.09803921729326248f, 0.09803921729326248f, 1.0f};
// .... omitted the rest

When I used ImGui.pushStyleColor(...), it worked, but that's obviously not what I want.

Brohammer5 commented 5 months ago

I think you need to do in order to properly have a new style.

Imgui.popStyle();