ImGui.Core:endDisabled

From GiderosMobile

Available since: Gideros 2020.9
Class: ImGui

Description

Ends a stack that can be disabled.

ImGui:endDisabled()

Example

require "ImGui"

local imgui = ImGui.new()
stage:addChild(imgui)

local window01 = true -- the starting state of window01, true=window is visible at start up

function onEnterFrame(e)
	-- 1 we start ImGui
	imgui:newFrame(e.deltaTime)

	-- 2 we add a child window and build our GUI
	if window01 then -- is window visible (not closed)?
		local windowdrawn = false -- is window expanded or colapsed?
		window01, windowdrawn = imgui:beginWindow( -- with close button
			"Hello ImGui v"..ImGui._VERSION, -- window title
			window01 -- returns window visibility
		)
		if windowdrawn then -- the variable is false when main window is collapsed
			imgui:text("This is an ImGui text.") -- we add a text element to our GUI
			imgui:textColored("This is a colored text.", 0xff00ff, 1)

			self.imgui:beginDisabled(true)
			imgui:text("This text is disabled!") -- the text is greyed out
			self.imgui:endDisabled()

			imgui:text("This text is not disabled.")
		end
	end

	-- 3 we end the frame and render to screen
	imgui:endFrame()
	imgui:render()
end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)




Dear ImGui