Difference between revisions of "ImGui.Core:showStyleEditor"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Adds a style editor block (not a window).
 
Adds a style editor block (not a window).
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
ImGui:showStyleEditor()
 
ImGui:showStyleEditor()
 
</source>
 
</source>
Line 12: Line 12:
  
 
=== 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

Adds a style editor block (not a window). <syntaxhighlight lang="lua"> ImGui:showStyleEditor() </source>

You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style).

Example

<syntaxhighlight lang="lua"> 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:showStyleEditor() self.imgui:endFrame() self.imgui:render() end

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