Difference between revisions of "ImGui.Core:setLightStyle"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets a light color style.
 
Sets a light color style.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
ImGui:setLightStyle()
 
ImGui:setLightStyle()
</source>
+
</syntaxhighlight>
  
 
Best used with borders and a custom, thicker font.
 
Best used with borders and a custom, thicker font.
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
MyClass = Core.class(Sprite)
 
MyClass = Core.class(Sprite)
  
Line 18: Line 18:
 
self.imgui = ImGui.new()
 
self.imgui = ImGui.new()
 
self:addChild(self.imgui)
 
self:addChild(self.imgui)
 +
self.imgui:setLightStyle()
 
-- LISTENERS
 
-- LISTENERS
 
self:addEventListener("enterBegin", self.onTransitionInBegin, self)
 
self:addEventListener("enterBegin", self.onTransitionInBegin, self)
Line 25: Line 26:
 
function MyClass:onEnterFrame(e)
 
function MyClass:onEnterFrame(e)
 
self.imgui:newFrame()
 
self.imgui:newFrame()
self.imgui:setLightStyle()
 
 
-- 2 we build our GUI
 
-- 2 we build our GUI
 
-- ...
 
-- ...
Line 36: Line 36:
 
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

Sets a light color style.

ImGui:setLightStyle()

Best used with borders and a custom, thicker font.

Example

MyClass = Core.class(Sprite)

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

-- LOOP
function MyClass:onEnterFrame(e)
	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