Difference between revisions of "ImGui.Core:inputTextMultiline"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' ImGui<br/> === Description === Sets a multiline input text. <source lang="lua"> (string), (bool) = ImGui...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets a multiline input text.
 
Sets a multiline input text.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string), (bool) = ImGui:inputTextMultiline(label, text, bufferSize, [w=0, h=0, ImGuiInputTextFlags=0])
 
(string), (bool) = ImGui:inputTextMultiline(label, text, bufferSize, [w=0, h=0, ImGuiInputTextFlags=0])
 
</source>
 
</source>
Line 22: Line 22:
  
 
=== 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 a multiline input text. <syntaxhighlight lang="lua"> (string), (bool) = ImGui:inputTextMultiline(label, text, bufferSize, [w=0, h=0, ImGuiInputTextFlags=0]) </source>

Parameters

label: (string) the label
text: (string) the text to be displayed
bufferSize: (number) sets a buffer size
w: (number) the input text width
h: (number) the input text height
ImGuiInputTextFlags : (number) the input text flag

Return values

Returns (string) 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 text = "my text"

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 text, isChanged = imgui:inputTextMultiline("text", text, 2*1024, 256, 128) if isChanged then print(text) end end -- 3 we end the frame and render to screen imgui:endFrame() imgui:render() end

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