Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
ifnot stackedButtons and b[loop,2]==""thenif ui:imageButton(b[loop,5],size-6,size-6)then
callButton=loop
endelseif ui:scaledImageButtonWithText(b[loop,5],b[loop,2],size,size,w,size)then
callButton=loop
end
local size=35local w=ui:getWindowContentRegionWidth()local iw=w
ifnot s.stackedButtons then
size=16local c=#b
for loop=1,#b doif b[loop,2]==""then
w-=(size+spX+2)
c-=1endendif c>0then w=((w+spX)/c)-spX endend
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
stackedbuttons is false b is a table with icon pointers, text, hint. if the text is "" then it makes a button with no text.
size is basically the size I want the icon to be with w being the actual button width.
The routine will auto-size the buttons to the width available.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@SinisterSoft , strange that you do this and it works properly ui:scaledImageButtonWithText(b[loop,5],b[loop,2],size,size,w,size) as it's supposed to be: pressFlag = ImGui:scaledImageButtonWithText(texture, text, w, h, [padding = -1, bgColor = 0xffffff, 0,tintColor = 0xffffff, 1, nil, nil, anchorX = 0.5, anchorY = 0.5]) so you set w for padding and size for bgColor?
@SinisterSoft , your code helped me to see that the args for scaledImageButtonWithText are wrong in the documentation. yet this way i'm unable to set padding and tintColor, which i also need.
There should be - but it looks like the docs are not in sync with the code. I think there are extra parameters that do stuff - try setting what you need after the iconw,iconh,boxw,boxh fields (or look at the source on github?)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
There should be - but it looks like the docs are not in sync with the code. I think there are extra parameters that do stuff - try setting what you need after the iconw,iconh,boxw,boxh fields (or look at the source on github?)
i looked at the source briefly but i did not manage to do what i wish after a short look. perhaps @rrraptor will sort it out for us quickly.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
i want to emulate an item being hovered/clicked. what is the most intelligent way to do this? what i want to achieve is that a button and a checkbox are glued together and i want that if i hover on any of them then the other also gets into hovered (visual) state. also if i click on any of them then the other also gets into clicked (visual) state.
the logic of setting the checkbox also if the button gets clicked i could do easily but the visual side seems to be more complicated. i guess with setting manually imgui:setStyleColor(ImGui.Col_Button, ...) for the other item would work but it needs to save state across multiple enterframe events etc. so i just hope there is a nicer solution.
another bug with dragint: if i double-click or ctrl-click to input exact value then while in this input mode i guess the state should be active (when queried with imgui:isItemActive()). now it is not and this messes up my tooltip behaviour (the help text is kept shown even if i move the mouse).
e.g. sliderInt works properly in this respect, when ctrl-clicked to input value directly then it gets into active state.
yet another question: if i input directly something to a sliderInt (using ctrl+click) then how can i make sure that i change my connected variable only when the value is final (enter was pressed)? i tried checking for isItemDeactivatedAfterEdit etc. and only updating my variable when needed, but whatever solution i do it either does not work correctly for direct input or it is good for direct input but it does not work at all for changing value by grabbing the slider.
yet another question: if i input directly something to a sliderInt (using ctrl+click) then how can i make sure that i change my connected variable only when the value is final (enter was pressed)? i tried checking for isItemDeactivatedAfterEdit etc. and only updating my variable when needed, but whatever solution i do it either does not work correctly for direct input or it is good for direct input but it does not work at all for changing value by grabbing the slider.
another bug with dragint: if i double-click or ctrl-click to input exact value then while in this input mode i guess the state should be active (when queried with imgui:isItemActive()). now it is not and this messes up my tooltip behaviour (the help text is kept shown even if i move the mouse).
@rrraptor does imgui have some kind of 'built-in' soft keyboard?
@SinisterSoft@hgy29 I just read an article here about Text Input for games on Android. It is supported by Google and has C API, so I think we can take a look and have something like "Android Game Development Kit" plugin for android would be great!
Must be your choice, but idk what you trying to achieve...
hi, with this i can achieve that both drag and textinput only updates when it is finished. but in fact i want drag to update continuously yet textinput should only update when it is finished. i tried many combinations, but i still could not achieve this. (thanks for your patience and help)
when using colorEdit3() in the popup i have two colors, current and original. yet in colorPicker3() i only have current. is there a way to show original also there? (i.e., my colorPicker3 outcome should be identical to the colorEdit3() outcome. thanks
i thought that a colorButton can automatically be the target of a drag-n-drop operation of a colorEdit3 but it is not the case. is that a bug? in other words: i can drop a colorEdit3 color on a colorButton but i cannot drop a colotButton color on anything.
i thought that a colorButton can automatically be the target of a drag-n-drop operation of a colorEdit3 but it is not the case. is that a bug? in other words: i can drop a colorEdit3 color on a colorButton but i cannot drop a colotButton color on anything.
You can always check features that you need in ImGui's demo windo, because its written in C++ If it works exactly the same way in LUA then its not a problem from my side.
Comments
Likes: keszegh
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh
https://deluxepixel.com
b is a table with icon pointers, text, hint. if the text is "" then it makes a button with no text.
size is basically the size I want the icon to be with w being the actual button width.
The routine will auto-size the buttons to the width available.
https://deluxepixel.com
ui:scaledImageButtonWithText(b[loop,5],b[loop,2],size,size,w,size)
as it's supposed to be:
pressFlag = ImGui:scaledImageButtonWithText(texture, text, w, h, [padding = -1, bgColor = 0xffffff, 0,tintColor = 0xffffff, 1, nil, nil, anchorX = 0.5, anchorY = 0.5])
so you set w for padding and size for bgColor?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
pressFlag = ImGui:scaledImageButtonWithText(texture, text, w, h, [padding = -1, bgColor = 0xffffff, 0,tintColor = 0xffffff, 1, nil, nil, anchorX = 0.5, anchorY = 0.5])
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
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://github.com/MultiPain/Gideros_ImGui/blob/4f7605ba706ea951a73a0874a4488f19233c1558/main.cpp#L2804
luaL_optinteger(L, X, 0) -- https://pgl.yoyo.org/luai/i/luaL_optinteger
X - 1 = LUA argument number
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://forum.giderosmobile.com/discussion/8448/light-and-dark-mode-detect-in-html5-exports/p1?new=1
The screenshots are my app that uses the imgui plugin.
Likes: keszegh
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh
what i want to achieve is that a button and a checkbox are glued together and i want that if i hover on any of them then the other also gets into hovered (visual) state. also if i click on any of them then the other also gets into clicked (visual) state.
the logic of setting the checkbox also if the button gets clicked i could do easily but the visual side seems to be more complicated. i guess with setting manually
imgui:setStyleColor(ImGui.Col_Button, ...) for the other item would work but it needs to save state across multiple enterframe events etc. so i just hope there is a nicer solution.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
if i double-click or ctrl-click to input exact value then while in this input mode i guess the state should be active (when queried with imgui:isItemActive()). now it is not and this messes up my tooltip behaviour (the help text is kept shown even if i move the mouse).
e.g. sliderInt works properly in this respect, when ctrl-clicked to input value directly then it gets into active state.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
if i input directly something to a sliderInt (using ctrl+click) then how can i make sure that i change my connected variable only when the value is final (enter was pressed)?
i tried checking for isItemDeactivatedAfterEdit etc. and only updating my variable when needed, but whatever solution i do it either does not work correctly for direct input or it is good for direct input but it does not work at all for changing value by grabbing the slider.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Must be your choice, but idk what you trying to achieve...No problems for me...
https://developer.android.com/games/agdk
https://developer.android.com/games/agdk/add-support-for-text-input
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
yet in colorPicker3() i only have current. is there a way to show original also there? (i.e., my colorPicker3 outcome should be identical to the colorEdit3() outcome. thanks
Fragmenter - animated loop machine and IKONOMIKON - the memory game
in other words: i can drop a colorEdit3 color on a colorButton but i cannot drop a colotButton color on anything.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
If it works exactly the same way in LUA then its not a problem from my side.