You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full config/build information:
Hello. I'm trying to develop a graphical user interface for LÖVE2D. I decided to use the love-imgui repo for this. In the main directory of my project, I have main.lua, imgui.dll, and the love-imgui repo. When I run the following code, I encounter the following issues:
require "imgui"
local showTestWindow = false
local showAnotherWindow = false
local floatValue = 0;
local sliderFloat = { 0.1, 0.5 }
local clearColor = { 0.2, 0.2, 0.2 }
local comboSelection = 1
local textValue = "text"
--
-- LOVE callbacks
--
function love.load(arg)
end
function love.update(dt)
imgui.NewFrame()
end
function love.draw()
-- Menu
if imgui.BeginMainMenuBar() then
if imgui.BeginMenu("File") then
imgui.MenuItem("Test")
imgui.EndMenu()
end
imgui.EndMainMenuBar()
end
-- Debug window
imgui.Text("Hello, world!");
clearColor[1], clearColor[2], clearColor[3] = imgui.ColorEdit3("Clear color", clearColor[1], clearColor[2], clearColor[3]);
-- Sliders
floatValue = imgui.SliderFloat("SliderFloat", floatValue, 0.0, 1.0);
sliderFloat[1], sliderFloat[2] = imgui.SliderFloat2("SliderFloat2", sliderFloat[1], sliderFloat[2], 0.0, 1.0);
-- Combo
comboSelection = imgui.Combo("Combo", comboSelection, { "combo1", "combo2", "combo3", "combo4" }, 4);
-- Windows
if imgui.Button("Test Window") then
showTestWindow = not showTestWindow;
end
if imgui.Button("Another Window") then
showAnotherWindow = not showAnotherWindow;
end
if showAnotherWindow then
imgui.SetNextWindowPos(50, 50, "ImGuiCond_FirstUseEver")
showAnotherWindow = imgui.Begin("Another Window", true, { "ImGuiWindowFlags_AlwaysAutoResize", "ImGuiWindowFlags_NoTitleBar" });
imgui.Text("Hello");
-- Input text
textValue = imgui.InputTextMultiline("InputText", textValue, 200, 300, 200);
imgui.End();
end
if showTestWindow then
showTestWindow = imgui.ShowDemoWindow(true)
end
love.graphics.clear(clearColor[1], clearColor[2], clearColor[3])
imgui.Render();
end
function love.quit()
imgui.ShutDown();
end
--
-- User inputs
--
function love.textinput(t)
imgui.TextInput(t)
if not imgui.GetWantCaptureKeyboard() then
-- Pass event to the game
end
end
function love.keypressed(key)
imgui.KeyPressed(key)
if not imgui.GetWantCaptureKeyboard() then
-- Pass event to the game
end
end
function love.keyreleased(key)
imgui.KeyReleased(key)
if not imgui.GetWantCaptureKeyboard() then
-- Pass event to the game
end
end
function love.mousemoved(x, y)
imgui.MouseMoved(x, y)
if not imgui.GetWantCaptureMouse() then
-- Pass event to the game
end
end
function love.mousepressed(x, y, button)
imgui.MousePressed(button)
if not imgui.GetWantCaptureMouse() then
-- Pass event to the game
end
end
function love.mousereleased(x, y, button)
imgui.MouseReleased(button)
if not imgui.GetWantCaptureMouse() then
-- Pass event to the game
end
end
function love.wheelmoved(x, y)
imgui.WheelMoved(y)
if not imgui.GetWantCaptureMouse() then
-- Pass event to the game
end
end
ERRORS :
Error
main.lua:4: module 'imgui.imgui' not found:
no field package.preload['imgui.imgui']
no 'imgui/imgui' in LOVE game directories.
no file 'imgui/imgui' in LOVE paths.
no file '.\imgui\imgui.lua'
no file 'C:\Program Files\LOVE\lua\imgui\imgui.lua'
no file 'C:\Program Files\LOVE\lua\imgui\imgui\init.lua'
no file '.\imgui\imgui.dll'
no file 'C:\Program Files\LOVE\imgui\imgui.dll'
no file 'C:\Program Files\LOVE\loadall.dll'
no module 'imgui.imgui' in file '.\imgui.dll'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'require'
main.lua:4: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
The text was updated successfully, but these errors were encountered:
Full config/build information:
Hello. I'm trying to develop a graphical user interface for LÖVE2D. I decided to use the love-imgui repo for this. In the main directory of my project, I have main.lua, imgui.dll, and the love-imgui repo. When I run the following code, I encounter the following issues:
The text was updated successfully, but these errors were encountered: