ImGui.Core:vFilledSliderInt

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2020.9
Class: ImGui

Description

Displays a regular vertical filled int slider. <syntaxhighlight lang="lua"> (number), (bool) =

 ImGui:vFilledSliderInt(label, mirrorFlag, w, h, value, min, max, [formatString="%d",
   ImGuiSliderFlags=0])

</source>

Parameters

label: (string) the label
mirrorFlag: (number) whether to mirror the slider or not
w: (number) the slider width
h: (number) the slider height
value: (number) the current value
min: (number) the min value
max: (number) the max value
formatString: (string) the format of the value
ImGuiSliderFlags: (number) the drag slider flag

Return values

Returns (number) the current value
Returns (bool) whether the current value has changed

Example

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

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

local window01 = true local value = 20

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 value, isChanged = imgui:vFilledSliderInt("slider vf", false, 32, 196, value, 0, 100, "%d", 0) if isChanged then print(value) end end -- 3 we end the frame and render to screen imgui:endFrame() imgui:render() end

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