Difference between revisions of "ImGui.Core:setColorEditOptions"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets the color edit options flag (when you right click on a color widget).
 
Sets the color edit options flag (when you right click on a color widget).
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
ImGui:setColorEditOptions(ImGuiColorEditFlags)
 
ImGui:setColorEditOptions(ImGuiColorEditFlags)
 
</source>
 
</source>
Line 13: Line 13:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
require "ImGui"
 
require "ImGui"
  

Revision as of 15:28, 13 July 2023

Available since: Gideros 2020.9
Class: ImGui

Description

Sets the color edit options flag (when you right click on a color widget). <syntaxhighlight lang="lua"> ImGui:setColorEditOptions(ImGuiColorEditFlags) </source>

Parameters

ImGuiColorEditFlags: (number) one of ImGui color edit flags

Example

<syntaxhighlight lang="lua"> require "ImGui"

local imgui = ImGui.new() stage:addChild(imgui) local CEF = ImGui.ColorEditFlags_NoOptions

local window01 = true local hexcolor = 0x00ff00 local alpha = 0.5 local originalcolor = 0xff0000 local originalalpha = 1.0

function onEnterFrame(e) -- 1 we start ImGui imgui:newFrame(e) -- 2 we add some child windows and build our GUI window01 = imgui:beginWindow("Window 01") -- no close button (X) if window01 then -- the variable is false when window is collapsed imgui:text("Hello Dear ImGui!") local isChanged = false hexcolor, alpha, originalcolor, originalalpha, isChanged = imgui:colorPicker4("label", hexcolor, alpha, CEF, originalcolor, originalalpha) if isChanged then print(hexcolor, alpha, originalcolor, originalalpha) end end -- 3 we end the frame and render to screen imgui:endFrame() imgui:render() end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame) </source>