Difference between revisions of "ImGui.Core:showStyleSelector"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' ImGui<br/> === Description === Adds a style selector block (not a window), essentially a combo listing t...")
 
Line 6: Line 6:
 
Adds a style selector block (not a window), essentially a combo listing the default styles.
 
Adds a style selector block (not a window), essentially a combo listing the default styles.
 
<source lang="lua">
 
<source lang="lua">
ImGui:showStyleSelector(string)
+
ImGui:showStyleSelector(style)
 
</source>
 
</source>
 +
 +
''style'' can be any of the following:
 +
*ImGui.StyleVar_GrabRounding
 +
*ImGui.StyleVar_Alpha
 +
*ImGui.StyleVar_WindowMinSize
 +
*ImGui.StyleVar_PopupBorderSize
 +
*ImGui.StyleVar_WindowBorderSize
 +
*ImGui.StyleVar_FrameBorderSize
 +
*ImGui.StyleVar_ItemSpacing
 +
*ImGui.StyleVar_IndentSpacing
 +
*ImGui.StyleVar_FramePadding
 +
*ImGui.StyleVar_WindowPadding
 +
*ImGui.StyleVar_ChildRounding
 +
*ImGui.StyleVar_ItemInnerSpacing
 +
*ImGui.StyleVar_WindowRounding
 +
*ImGui.StyleVar_FrameRounding
 +
*ImGui.StyleVar_TabRounding
 +
*ImGui.StyleVar_ChildBorderSize
 +
*ImGui.StyleVar_GrabMinSize
 +
*ImGui.StyleVar_ScrollbarRounding
 +
*ImGui.StyleVar_ScrollbarSize
 +
*ImGui.StyleVar_WindowTitleAlign
 +
*ImGui.StyleVar_SelectableTextAlign
 +
*ImGui.StyleVar_PopupRounding
 +
*ImGui.StyleVar_ButtonTextAlign
 +
*ImGui.StyleVar_CellPadding
  
 
=== Parameters ===
 
=== Parameters ===
'''string''': (string) the chosen style<br/>
+
'''style''': (string) any of the above style<br/>
  
 
=== Example ===
 
=== Example ===
Line 26: Line 52:
 
function MyClass:onEnterFrame(e)
 
function MyClass:onEnterFrame(e)
 
self.imgui:newFrame(e)
 
self.imgui:newFrame(e)
self.imgui:showStyleSelector()
+
self.imgui:showStyleSelector(StyleVar_PopupRounding)
 
self.imgui:endFrame()
 
self.imgui:endFrame()
 
self.imgui:render()
 
self.imgui:render()

Revision as of 03:41, 23 March 2021

Available since: Gideros 2020.9
Class: ImGui

Description

Adds a style selector block (not a window), essentially a combo listing the default styles.

ImGui:showStyleSelector(style)

style can be any of the following:

  • ImGui.StyleVar_GrabRounding
  • ImGui.StyleVar_Alpha
  • ImGui.StyleVar_WindowMinSize
  • ImGui.StyleVar_PopupBorderSize
  • ImGui.StyleVar_WindowBorderSize
  • ImGui.StyleVar_FrameBorderSize
  • ImGui.StyleVar_ItemSpacing
  • ImGui.StyleVar_IndentSpacing
  • ImGui.StyleVar_FramePadding
  • ImGui.StyleVar_WindowPadding
  • ImGui.StyleVar_ChildRounding
  • ImGui.StyleVar_ItemInnerSpacing
  • ImGui.StyleVar_WindowRounding
  • ImGui.StyleVar_FrameRounding
  • ImGui.StyleVar_TabRounding
  • ImGui.StyleVar_ChildBorderSize
  • ImGui.StyleVar_GrabMinSize
  • ImGui.StyleVar_ScrollbarRounding
  • ImGui.StyleVar_ScrollbarSize
  • ImGui.StyleVar_WindowTitleAlign
  • ImGui.StyleVar_SelectableTextAlign
  • ImGui.StyleVar_PopupRounding
  • ImGui.StyleVar_ButtonTextAlign
  • ImGui.StyleVar_CellPadding

Parameters

style: (string) any of the above style

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:showStyleSelector(StyleVar_PopupRounding)
	self.imgui:endFrame()
	self.imgui:render()
end

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