Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
ImGui new thread - Page 8 — Gideros Forum

ImGui new thread

1234568»

Comments

  • keszeghkeszegh Member
    rrraptor said:

    keszegh said:

    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.
    thanks, i can also use https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html to check if the gideros demo window behaves as the original. and in this case it seems that indeed colorButton has this strange behaviour, so i will do some workaround (using a colorEdit3 with disabled popup).
  • keszeghkeszegh Member
    when calling

    colorlist[i],isTouching = imgui:colorEdit3("quick color "..i, colorlist[i],ImGui.ColorEditFlags_NoInputs|ImGui.ColorEditFlags_NoOptions|ImGui.ColorEditFlags_NoLabel |ImGui.ColorEditFlags_NoTooltip|ImGui.ColorEditFlags_NoPicker)

    isTouching never seems to be true, although i guess it should be when i click on the item.
  • rrraptorrrraptor Member
    edited July 23
    keszegh said:

    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

    keszegh said:

    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.

    Added 2 functions, so its possible now

    Code:
    ui:colorButton("Test", clr1, alh1, 0, 0, ImGui.ColorEditFlags_AlphaBar | ImGui.ColorEditFlags_AlphaPreviewHalf | ImGui.ColorEditFlags_AlphaPreview)
    if (ui:beginDragDropTarget()) then
    	local payload = ui:acceptDragDropPayload("_COL4F")
    	if (payload) then
    		local color, alpha = payload:getColor4Data()
    		if (color) then 
    			print(color, alpha)
    			clr1, alh1 = color, alpha
    		end
    	else
    		local payload = ui:acceptDragDropPayload("_COL3F")
    		if (payload) then
    			local color = payload:getColor3Data()
    			if (color) then 
    				clr1 = color
    			end
    		end
    	end
    	ui:endDragDropTarget()
    end
    clr2, alh2 = ui:colorEdit4("Color 2", clr2, alh2, ImGui.ColorEditFlags_AlphaBar | ImGui.ColorEditFlags_AlphaPreviewHalf | ImGui.ColorEditFlags_AlphaPreview)
    clr3 = ui:colorEdit3("Color 3", clr3)

    Likes: MoKaLux, keszegh

    +1 -1 (+2 / -0 )Share on Facebook
  • keszeghkeszegh Member
    hi, can't wait for these new features to end up in a release. thanks
  • rrraptorrrraptor Member
    edited July 23
    keszegh said:

    hi, can't wait for these new features to end up in a release. thanks

    ImGui:colorPicker3(). Its possible to add "original color", but I need to change original sources, but I dont want to do it.
    ImGui:colorPicker4() have it out of the box, BUT you must provide it by ur self.
    hexColor, alpha, originalColor, originalAlpha, isTouchingFlag = ImGui:colorPicker4(label, color [, ImGuiColorEditFlags = 0, originalColor = 0xffffff, 1])
    Drag&Drop pull request is not merged yet.
  • keszeghkeszegh Member
    strange that picker3 and picker4 behave differently from this aspect.
  • rrraptorrrraptor Member
    edited July 23
    Actually, you can easily make colorPicker3 with ref color by using colorPicker4:
    color = ui:colorPicker4("Emulate colorPicker3", color, 1, ImGui.ColorEditFlags_NoAlpha, originalColor)
    Just add "ImGui.ColorEditFlags_NoAlpha" flag :)

    Likes: keszegh

    +1 -1 (+1 / -0 )Share on Facebook
  • keszeghkeszegh Member
    ScaledImageFilled etc documentation is also wrong. i try to guess the things using the source code but for some reason i have difficulties with that.
  • rrraptorrrraptor Member
    edited July 27
    keszegh said:

    i have difficulties with that.

    Mb that will help :)

    Argument number is off by 1 because from LUA we can call functions like that:
    myObject:myFunc(arg1, arg2, ...)
    but its actually a syntax sugar for:
    myObject.myFunc(myObject, arg1, arg2, ...)



    For "ScaledImageFilled" it must be:
    ImGui:scaledImageFilled(texture_or_rt, bg_w, bg_h, image_w, image_h [, tint_color = 0xffffff, tint_alpha = 1, 
    bg_color = 0, bg_alpha = 1, border_color = 0xffffff, border_alpha = 0, 
    anchor_x = 0.5, anchor_y = 0.5, frame_round = 0] )
    -- left align 
    ui:scaledImageFilled(texture, 256, 128, 128, 128, 0xff00ff, 1, 0xff0000, 1, 0, 1, 0, 0.5, 8)
    -- right align
    ui:scaledImageFilled(texture, 256, 256, 128, 128, nil, nil, nil, nil, 0, 1, 1, 0.5, 20)

  • rrraptorrrraptor Member
    edited July 27
    keszegh said:

    thanks.
    which file to check? i used https://github.com/MultiPain/Gideros_ImGui/blob/master/imgui_user.cpp so far but you showed parts of another.

    This one is actual code, but u need to look at functions bindings that is called from LUA.
    All functions here:
    https://github.com/MultiPain/Gideros_ImGui/blob/master/main.cpp

    Here is a list of functions names associated with their objects:
    https://github.com/MultiPain/Gideros_ImGui/blob/ee021e26061201f12c0053c432b23ab85d127c30/main.cpp#L10529

    For example, I have "imguiDrawListFunctionList" - functions for draw list object, you can confirm it here: https://github.com/MultiPain/Gideros_ImGui/blob/ee021e26061201f12c0053c432b23ab85d127c30/main.cpp#L10672
    "ImDrawList" is the name of the object.
    If u see something like:
    g_pushInstance(L, "ImDrawList", object)
    then this function returns an object which uses this list.
    Or if I have something like this:
    ImGuiTableSortSpecs* specs = getPtr<ImGuiTableSortSpecs>(L, "ImGuiTableSortSpecs");
    then it uses this list: https://github.com/MultiPain/Gideros_ImGui/blob/ee021e26061201f12c0053c432b23ab85d127c30/main.cpp#L11088
  • keszeghkeszegh Member
    thanks, this might shed enough light for the futute. of course it's best if the documentation is not wrong, but from now on perhaps i will be brave enough to correct it too.

    another thing: is there a way to set that inputText shows the already entered text right-aligned (e.g., think about your file-dialog and the current path view on the top, it would be more useful to show the end of it instead of the beginning, if it does not fit the box)?
Sign In or Register to comment.