Difference between revisions of "ImGui.Core:showDemoWindow"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' Dear ImGui<br/> === Description === Displays an ImGui demo. <source lang="lua"> ImGui.showDemoWindow() <...")
 
Line 4: Line 4:
  
 
=== Description ===
 
=== Description ===
Displays an ImGui demo.
+
Displays an ImGui demo window.
 
<source lang="lua">
 
<source lang="lua">
 
ImGui.showDemoWindow()
 
ImGui.showDemoWindow()
Line 14: Line 14:
  
 
function MyClass:init()
 
function MyClass:init()
application:setBackgroundColor(0x111111)
 
-- imgui init
 
 
self.imgui = ImGui.new()
 
self.imgui = ImGui.new()
-- order
 
 
self:addChild(self.imgui)
 
self:addChild(self.imgui)
 
-- LISTENERS
 
-- LISTENERS

Revision as of 00:08, 17 March 2021

Available since: Gideros 2020.9
Class: Dear ImGui

Description

Displays an ImGui demo window.

ImGui.showDemoWindow()

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