Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
I encountered an error about ImGui,can anyone help me? — Gideros Forum

I encountered an error about ImGui,can anyone help me?



Please tell me how to code?


IO:setFontGlobalScale(2.5)
--imgui:setLightStyle()A
--imgui:setClassicStyleA()
-- some vars
local xtext, xtext2 = "Centered Text", "Colored Text"

-- the loop
function enterFrame(e)
local CW = application:getContentWidth()

-- 1 begin
imgui:newFrame(e)

-- 2 our GUI
if (imgui:beginFullScreenWindow("Hello ImGui", nil)) then
-- some spacing
imgui:dummy(CW, 32 * 2) -- imgui:dummy(w, h)
-- a centered text
local textW = imgui:calcTextSize(xtext)
local textMid = (CW - textW) / 2
imgui:dummy(textMid, 0)
imgui:sameLine(0, 0) -- puts the next element on the same line with no gap, for gaps use imgui:sameLine()
imgui:text(xtext)
-- some spacing
imgui:dummy(CW, 32 * 4)
-- a colored text
imgui:textColored(xtext2, 0xff00ff)
imgui:endWindow()

-- 3 end
end
imgui:endFrame()
imgui:render()
end

-- the listeners
stage:addEventListener("enterFrame", enterFrame)

Comments

Sign In or Register to comment.