Difference between revisions of "ImGui.Core:beginWindow"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' Dear ImGui<br/> === Description === Pushes window to the stack and starts appending to it. <source lang=...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2020.9<br/>
 
'''Available since:''' Gideros 2020.9<br/>
'''Class:''' [[Dear ImGui]]<br/>
+
'''Class:''' [[ImGui]]<br/>
  
 
=== Description ===
 
=== Description ===

Revision as of 02:23, 23 March 2021

Available since: Gideros 2020.9
Class: ImGui

Description

Pushes window to the stack and starts appending to it.

(bool) (bool) = ImGui:beginWindow(name,open,flags)

Parameters

name: (string) the window title to be displayed
open: (bool) the status of the window, true=opened, false=collapsed
flags: (string) some flags for the window (wiki in progress)

Return values

Returns: (bool) whether the window exists
Returns: (bool) the status of the window, true=opened, false=collapsed

Example

-- LOOP
function MyClass:onEnterFrame(e)
	self.imgui:newFrame(e)
	if (self.window01) then -- if window exists
		local windowdrawn = false
		self.window01, windowdrawn = self.imgui:beginWindow(
			"Hello ImGui v"..ImGui._VERSION, -- window title
			self.window01 -- is window expanded
		)
		if (windowdrawn) then
			self.imgui:text("Hello Dear ImGui!")
		end
		self.imgui:endWindow()
	end
	self.imgui:endFrame()
	self.imgui:render()
end