i still have to understand how it works. 1. can you post an example of tabs? 2. also i want sliders that look like progress bars (i.e. fill up from left side). how can i do that? EDIT: 3. also, what is the easiest way to make a button which contains a texture and text as well. EDIT: 4. how to make zero gap between two elements next to each other? (like two buttons to look like one)
@rrraptor , i've managed to solve my question 4., sameLine(0) adds zero gap. i wanted to use this to solve question 3. but sadly even if two buttons 'look' to be as one (with zero gap), hovering on them only highlights one of them, so it's not an optimal solution to emulate 3.
Actually, there is a bug in "ImGui:sameLine([offsetX = 0, spacing = -1])", I messed up arguments numbers, so that "offsetX" is completely ignored. Now, instead of "sameLine(0)" it should be "sameLine(0,0)"
another note that in general it's a bit risky to move to a gui system that i cannot tweak. of course i could add/change the source code but then i'd need to compile the plugin myself. if there is a tutorial for that which i can repeat, i'd be happy if you'd share that (i tried once or twice to compile gideros from source on windows but never succeeded).
about sliderInt, it seems that it's now: imgui:sliderInt(label,value,min, max, value) (note that i have value twice so that it works - perhaps one is the value where the slider is set and other is the value written on the slider?) instead of ImGui:sliderInt(label, value, [incStep = 1, min = 0, max = 0, formatString = "%d"])
@keszegh so you want icons on buttons/tabs/other widgets, right? It can be done using fonts. BUT! Fonts API is not finished and it does not have antialiasing yet. Idk how to fix it, so I guess we need to wait for @hgy29 ... ?
another note that in general it's a bit risky to move to a gui system that i cannot tweak. of course i could add/change the source code but then i'd need to compile the plugin myself. if there is a tutorial for that which i can repeat, i'd be happy if you'd share that (i tried once or twice to compile gideros from source on windows but never succeeded).
Idk how to make it exportable, so maybe @hgy29 can help you.
about sliderInt, it seems that it's now: imgui:sliderInt(label,value,min, max, value) (note that i have value twice so that it works - perhaps one is the value where the slider is set and other is the value written on the slider?) instead of ImGui:sliderInt(label, value, [incStep = 1, min = 0, max = 0, formatString = "%d"])
imgui:imageButtonWithText does not seem to work... actually the issue seems to be when two buttons (even simple text buttons) with the same parameters (i.e., text) are created, then they are not distinguished and this messes up imgui. is there a way to make two buttons with the same text and so that they still work as expected? kind of adding a distinguishing label which is not visible on the button?
this is which does not work:
if imgui:button("butt")thenprint("a")endif imgui:button("butt")thenprint("b")end
in this case pressing second butt(on) does nothing (whereas i'd want it to print 'b').
@keszegh Thats how ImGui works (I guess it takes button text as ID).
if imgui:button("butt")thenprint("a")end
imgui:pushSID("MyButton2", nil)if imgui:button("butt")thenprint("b")end
imgui:popID()
You need to give unique ID to you button. Currently you can use ImGui:pushSID(string, nil) or ImGui:pushNID(number), then create widget and call ImGui:popID()
IDK whats the difference between first and second implementation, so I just added a check for 2d arg :
int ImGui_impl_PushID_string(lua_State *L){if(lua_type(L,3)== LUA_TNIL){
ImGui::PushID(luaL_checkstring(L,2));}else{
ImGui::PushID(luaL_checkstring(L,2), luaL_checkstring(L,3));}return0;}
But seems like it should be something like:
int ImGui_impl_PushID_string(lua_State *L){if(lua_gettop(L)==2)// only 2 arguments passed{
ImGui::PushID(luaL_checkstring(L,2));}else{
ImGui::PushID(luaL_checkstring(L,2), luaL_checkstring(L,3));}return0;}
@rrraptor , yes, sorry if i was not clear, the issue was with the id's, now that i use push/popid, it works fine.
although i did not go through all my gui elements, i think most could be replaced by imgui (and be better for it), except for the slider-progressbar (and a horizontally mirrored counterpart), if you find a better solution for it, let me know. bit more generally, it would be great to add some rangeslider solution: https://github.com/ocornut/imgui/issues/76
@keszegh Ok, I figured out how to make this type of sliders
I have changed a single line in slider behavior function and it works. Hmm, I wonder how can I make is so I dont need to add new set of sliders cuz there is A LOT of them
@rrraptor , looks perfect. i think it does not matter if there are more types, at least from a user perspective.
btw in the future i wanted to improve my 'timeline' slider in my animation app by add bars to places where there is a nonempty 'key'frame. i wonder if i will be able to do that (rects should work but they will again be above the number and the slider which is not so good).
@rrraptor , for the mirrored filled slider i need that the values are also reversed (that is, it goes from 100 to 0). i can set the range to 100,0 but strangely then i cannot pull it to to 0, the filledslider stops at 1.
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
If you are on windows, put dll into "Plugins" folder:
Example project is in archive. Keep in mind that some function might not work at all
P.S. works ONLY on windows and in Gideros player. Cant be exported.
Likes: MoKaLux, keszegh, antix
Likes: MoKaLux, SinisterSoft, antix
1. can you post an example of tabs?
2. also i want sliders that look like progress bars (i.e. fill up from left side). how can i do that?
EDIT: 3. also, what is the easiest way to make a button which contains a texture and text as well.
EDIT: 4. how to make zero gap between two elements next to each other? (like two buttons to look like one)
thanks
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Code:
Play aound with "ImGui:indent()" and "ImGui:unindent()"Indeed, sameLine(0) works
Likes: keszegh, MoKaLux
Added fixed dll to GitHub page:
https://github.com/MultiPain/Gideros_ImGui
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
another note that in general it's a bit risky to move to a gui system that i cannot tweak. of course i could add/change the source code but then i'd need to compile the plugin myself. if there is a tutorial for that which i can repeat, i'd be happy if you'd share that (i tried once or twice to compile gideros from source on windows but never succeeded).
Fragmenter - animated loop machine and IKONOMIKON - the memory game
imgui:sliderInt(label,value,min, max, value)
(note that i have value twice so that it works - perhaps one is the value where the slider is set and other is the value written on the slider?)
instead of
ImGui:sliderInt(label, value, [incStep = 1, min = 0, max = 0, formatString = "%d"])
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
-imgui:imageButtonWithText does not seem to return a true value.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
this is which does not work:
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Thats how ImGui works (I guess it takes button text as ID).
Originaly ImGui:pushID() have 4 overloads:
Likes: keszegh
ImGui:getID() should be also reworked.
Works as expected, maybe it does not work for you because of ImGui ID system?)
although i did not go through all my gui elements, i think most could be replaced by imgui (and be better for it), except for the slider-progressbar (and a horizontally mirrored counterpart), if you find a better solution for it, let me know.
bit more generally, it would be great to add some rangeslider solution:
https://github.com/ocornut/imgui/issues/76
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
https://github.com/ocornut/imgui/blob/master/imgui.h
and maybe here:
https://github.com/ocornut/imgui/blob/master/imgui.cpp
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Ok, I figured out how to make this type of sliders
I have changed a single line in slider behavior function and it works. Hmm, I wonder how can I make is so I dont need to add new set of sliders cuz there is A LOT of them
btw in the future i wanted to improve my 'timeline' slider in my animation app by add bars to places where there is a nonempty 'key'frame. i wonder if i will be able to do that (rects should work but they will again be above the number and the slider which is not so good).
Fragmenter - animated loop machine and IKONOMIKON - the memory game
P.S. Ive updated dll on github. It is now have new sliders:
Likes: keszegh, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game