imgui child

KRATEIN

Новичок
Автор темы
17
0
Версия MoonLoader
Другое
1637607925994.png

короче мне нужно чтобы если нажал на кнопку 1 появился текст справа. я ебусь с этой хуйнёй уже полтора часа чё делать? могу код предоставить если нужно

 
Последнее редактирование:
Решение
На примере mimgui.
в moon imgui смысл тот же
Lua:
local selected = 0

imgui.OnFrame(
    function() return true end,
    function() end,
    function(self)
        imgui.Begin(...)
            imgui.BeginChild(...)
                if imgui.Button("1") then selected = 1 end
                if imgui.Button("2") then selected = 2 end
            imgui.EndChild()
           
            imgui.SameLine()
            imgui.BeginChild(...)
                if selected == 1 then
                    imgui.Text("selected first window")
                elseif selected == 2 then
                    imgui.Text("selected second window")
                else
                    imgui.Text("nothing selected")
                end...

meowprd

Тот самый Котовский
Проверенный
1,283
711
На примере mimgui.
в moon imgui смысл тот же
Lua:
local selected = 0

imgui.OnFrame(
    function() return true end,
    function() end,
    function(self)
        imgui.Begin(...)
            imgui.BeginChild(...)
                if imgui.Button("1") then selected = 1 end
                if imgui.Button("2") then selected = 2 end
            imgui.EndChild()
           
            imgui.SameLine()
            imgui.BeginChild(...)
                if selected == 1 then
                    imgui.Text("selected first window")
                elseif selected == 2 then
                    imgui.Text("selected second window")
                else
                    imgui.Text("nothing selected")
                end
            imgui.EndChild()
        imgui.End(...)
    end
)
 
Последнее редактирование:
  • Нравится
Реакции: KRATEIN

KRATEIN

Новичок
Автор темы
17
0
На примере mimgui.
в moon imgui смысл тот же
Код:
local selected = 0

imgui.OnFrame(
    function() return true end,
    function() end,
    function(self)
        imgui.Begin(...)
            imgui.BeginChild(...)
                if imgui.Button("1") then selected = 1 end
                if imgui.Button("2") then selected = 2 end
            imgui.EndChild()
           
            imgui.SameLine()
            imgui.BeginChild(...)
                if selected == 1 then
                    imgui.Text("selected first window")
                elseif selected == 2 then
                    imgui.Text("selected second window")
                else
                    imgui.Text("nothing selected")
                end
            imgui.EndChild()
        imgui.End(...)
    end
)
спасибо большое, выручил ))