вертикальные кнопки

sadasdasdasdasdasd

Известный
Автор темы
81
16
как сделать что бы было вертикально а не горизонтально? и то, информация которая выводится от туда, справа, а не снизу

Lua:
if imgui.Button('One', (imgui.ImVec2(100, 50))) then
             active = true
            active1 = false
            active2 = false
        end
        if imgui.Button('Two', (imgui.ImVec2(100, 50))) then
            active = false
            active1 = true
            active2 = false
        end
        if imgui.Button('Three', (imgui.ImVec2(100, 50))) then
            active = false
            active1 = false
            active2 = true
        end
        if active then
        imgui.BeginChild('text', imgui.ImVec2(100 , 100))
        imgui.Text('test')
        imgui.EndChild()
    end
    if active1 then
        imgui.BeginChild('text1', imgui.ImVec2(100 , 100))
        imgui.Text('test1')
        imgui.EndChild()
    end
    if active2 then
        imgui.BeginChild('text2', imgui.ImVec2(100 , 100))
        imgui.Text('test2')
        imgui.EndChild()
    end
    imgui.End()
 

ervinbek

Известный
244
77
как сделать что бы было вертикально а не горизонтально? и то, информация которая выводится от туда, справа, а не снизу

Lua:
if imgui.Button('One', (imgui.ImVec2(100, 50))) then
             active = true
            active1 = false
            active2 = false
        end
        if imgui.Button('Two', (imgui.ImVec2(100, 50))) then
            active = false
            active1 = true
            active2 = false
        end
        if imgui.Button('Three', (imgui.ImVec2(100, 50))) then
            active = false
            active1 = false
            active2 = true
        end
        if active then
        imgui.BeginChild('text', imgui.ImVec2(100 , 100))
        imgui.Text('test')
        imgui.EndChild()
    end
    if active1 then
        imgui.BeginChild('text1', imgui.ImVec2(100 , 100))
        imgui.Text('test1')
        imgui.EndChild()
    end
    if active2 then
        imgui.BeginChild('text2', imgui.ImVec2(100 , 100))
        imgui.Text('test2')
        imgui.EndChild()
    end
    imgui.End()
practica:
if imgui.Button('One', (imgui.ImVec2(100, 50))) then
    active = true
    active1 = false
    active2 = false
end
if imgui.Button('Two', (imgui.ImVec2(100, 50))) then
    active = false
    active1 = true
    active2 = false
end
if imgui.Button('Three', (imgui.ImVec2(100, 50))) then
    active = false
    active1 = false
    active2 = true
end

imgui.Columns(1) 

if active then
    imgui.NextColumn() 
    imgui.SetCursorPosX(imgui.GetColumnWidth() - imgui.CalcTextSize('test').x) 
    imgui.Text('test')
end

if active1 then
    imgui.NextColumn() 
    imgui.SetCursorPosX(imgui.GetColumnWidth() - imgui.CalcTextSize('test1').x) 
    imgui.Text('test1')
end

if active2 then
    imgui.NextColumn() 
    imgui.SetCursorPosX(imgui.GetColumnWidth() - imgui.CalcTextSize('test2').x)
    imgui.Text('test2')
end

imgui.Columns(1) 

imgui.End()
 

Dmitriy Makarov

25.05.2021
Проверенный
2,481
1,113
 
  • Нравится
Реакции: MLycoris