local windowPos = {
x = 0,
y = 0
}
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
end)
imgui.OnFrame( --* Background
function() return window[0] end,
function() end,
function(self)
imgui.SetNextWindowPos(imgui.ImVec2(windowPos.x - 110, windowPos.y), imgui.Cond.Always) -- 110 = 100 (размер текущего окна по X) + 10 (небольшой отступ)
imgui.SetNextWindowSize(imgui.ImVec2(100, 200), imgui.Cond.Always)
imgui.Begin("first window", _, imgui.WindowFlags.NoResize)
imgui.Text("This is first window!")
imgui.End()
end
)
imgui.OnFrame(
function() return window[0] end,
function() end,
function(self)
local sw, sh = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(sw/2, sh/2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(800, 480), imgui.Cond.FirstUseEver)
imgui.Begin("second window", _, imgui.WindowFlags.NoResize)
imgui.Text("This is second window")
local pos = imgui.GetWindowPos()
windowPos.x, windowPos.y = pos.x, pos.y
imgui.End()
end
)