Difference between revisions of "ImGui.Core:render"

From GiderosMobile
m (MoKaLux moved page ImGui:render to ImGui.Core:render)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Ends the ImGui frame, finalizes the draw data. You can then call getDrawData().
 
Ends the ImGui frame, finalizes the draw data. You can then call getDrawData().
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
ImGui:render()
 
ImGui:render()
 
</source>
 
</source>
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
MyClass = Core.class(Sprite)
 
MyClass = Core.class(Sprite)
  

Revision as of 15:28, 13 July 2023

Available since: Gideros 2020.9
Class: ImGui

Description

Ends the ImGui frame, finalizes the draw data. You can then call getDrawData(). <syntaxhighlight lang="lua"> ImGui:render() </source>

Example

<syntaxhighlight lang="lua"> MyClass = Core.class(Sprite)

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

-- LOOP function MyClass:onEnterFrame(e) -- 1 we start ImGui self.imgui:newFrame() -- 2 we build our GUI -- ... self.imgui:endFrame() self.imgui:render() end

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