Difference between revisions of "ImGui.Core:showDemoWindow"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
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 ===
 
Displays an ImGui demo window.
 
Displays an ImGui demo window.
<source lang="lua">
+
<syntaxhighlight lang="lua">
ImGui.showDemoWindow()
+
ImGui:showDemoWindow(bool)
</source>
+
</syntaxhighlight>
 +
 
 +
=== Parameters ===
 +
'''bool''': (boolean) whether or not to show the window<br/>
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
MyClass = Core.class(Sprite)
 
MyClass = Core.class(Sprite)
  
Line 32: Line 35:
 
self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
 
self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
 
end
 
end
</source>
+
</syntaxhighlight>
  
 
{{ImGui}}
 
{{ImGui}}

Latest revision as of 15:29, 13 July 2023

Available since: Gideros 2020.9
Class: ImGui

Description

Displays an ImGui demo window.

ImGui:showDemoWindow(bool)

Parameters

bool: (boolean) whether or not to show the window

Example

MyClass = Core.class(Sprite)

function MyClass:init()
	self.imgui = ImGui.new()
	self:addChild(self.imgui)
	-- LISTENERS
	self:addEventListener("enterBegin", self.onTransitionInBegin, self)
end

-- LOOP
function MyClass:onEnterFrame(e)
	self.imgui:newFrame(e)
	self.imgui:showDemoWindow()
	self.imgui:endFrame()
	self.imgui:render()
end

-- EVENT LISTENERS
function MyClass:onTransitionInBegin()
	self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
end