Помощь с Imgui

TheHell

Участник
Автор темы
46
7
0.png


Как создать такое меню? Можете дать пример кода на lua
 
Решение
если чисто дизайн, то могу на мимгуи кинуть пример
1722026686298.png


Lua:
local imgui = require 'mimgui'

local WinState = imgui.new.bool(1)

local buttonsArray = {
    {'Button1', 'Some text one'},
    {'But 2', 'Some text two'},
    {'Smsdfs', 'Some te'},
    {'rhyrhgf', 'Some txtne'},
    {'dfgdr', 'Somtex one'},
    {'cvb', 'Somtext one'},
}
local curAct = 1

imgui.OnFrame(function() return WinState[0] end, function(player)
    imgui.SetNextWindowPos(imgui.ImVec2(500,500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    imgui.SetNextWindowSize(imgui.ImVec2(500, 500), imgui.Cond.FirstUseEver)
    imgui.Begin('##Window', WinState)

    if imgui.BeginChild('Buttons', imgui.ImVec2(160, 250), true) then
        for i = 1, #buttonsArray do...

MLycoris

Режим чтения
Проверенный
1,941
2,064
если чисто дизайн, то могу на мимгуи кинуть пример
1722026686298.png


Lua:
local imgui = require 'mimgui'

local WinState = imgui.new.bool(1)

local buttonsArray = {
    {'Button1', 'Some text one'},
    {'But 2', 'Some text two'},
    {'Smsdfs', 'Some te'},
    {'rhyrhgf', 'Some txtne'},
    {'dfgdr', 'Somtex one'},
    {'cvb', 'Somtext one'},
}
local curAct = 1

imgui.OnFrame(function() return WinState[0] end, function(player)
    imgui.SetNextWindowPos(imgui.ImVec2(500,500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    imgui.SetNextWindowSize(imgui.ImVec2(500, 500), imgui.Cond.FirstUseEver)
    imgui.Begin('##Window', WinState)

    if imgui.BeginChild('Buttons', imgui.ImVec2(160, 250), true) then
        for i = 1, #buttonsArray do
            if imgui.Selectable(buttonsArray[i][1], i == curAct) then
                curAct = i
            end
        end
        imgui.EndChild()
        
    end
    imgui.SameLine()
    if imgui.BeginChild('Name 2', imgui.ImVec2(imgui.GetWindowWidth()-190, 250), false) then
        imgui.Text(buttonsArray[curAct][1])
        imgui.Separator()
        imgui.Text(buttonsArray[curAct][2])
        imgui.EndChild()
        
    end
    imgui.End()
end)
 
  • Нравится
Реакции: TheHell, VanoKLR и Smeruxa