kotlin-graphics / imgui

Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
MIT License
594 stars 37 forks source link

how does inputText work in java 8? #150

Closed gurachan closed 3 years ago

gurachan commented 3 years ago
byte[] msg = new byte[256];
public void window() {
   UI.inputText("##wwhah", msg, 0, null, null);
///boolean imgui.ImGui.inputText(@NotNull String label, @NotNull byte[] buf, int flags, @Nullable Function1<? super InputTextCallbackData, Boolean> callback, @Nullable Object userData)

}

sometimes it works sometimes not. like it auto-clear msg itself. if I use a simple String i can't type either.

i dont know kotlin that much do i need callback to make it work something?

even using UI.setKeyboardFocusHere(-1);

if i print that msg i can see what im typing then it auto backspace it for some reason

gurachan commented 3 years ago

hmm, it seems that at first window show it works then if u hide it and show it again that's where it begins.

gurachan commented 3 years ago

I followed this guide https://github.com/breadbyte/fabric-example-imgui/blob/master/src/main/java/net/fabricmc/example/screen/ImguiScreen.java

if you open the screen.. then open the demo console and it works just fine... then leave it open then close the screen.. the input text no longer functioning right every character you typed gets deleted... :(