Package imgui.type
Class ImString
java.lang.Object
imgui.type.ImString
- All Implemented Interfaces:
Cloneable,Comparable<ImString>
Wrapper for
String to use inside th Dear ImGui input widgets.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUse this class to customize your ImGui input. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortSize of ImGui caret which is shown during the input text focus.static final shortDefault size of the inner buffer, ifImStringcreated with a constructor without args.final ImString.InputDataConfiguration class to set up some specific behaviour for current string. -
Constructor Summary
ConstructorsConstructorDescriptionImString()Creates anImStringinstance withDEFAULT_LENGTHsize for the inner buffer.ImString(int length) Creates anImStringinstance with provided size for the inner buffer.Creates anImStringinstance from provided string.Create anImStringinstance from provided string with custom size for the inner buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears underlying string by setting empty value.clone()intbooleanget()intGet the size of the data buffer.byte[]getData()intGet the length of the text inside the data buffer.inthashCode()booleanisEmpty()booleanvoidresize(int newSize) voidvoidvoidvoidvoidvoidtoString()
-
Field Details
-
DEFAULT_LENGTH
public static final short DEFAULT_LENGTHDefault size of the inner buffer, ifImStringcreated with a constructor without args.- See Also:
-
CARET_LEN
public static final short CARET_LENSize of ImGui caret which is shown during the input text focus.- See Also:
-
inputData
Configuration class to set up some specific behaviour for current string. This is useful when string used inside ImGui#InputText*() methods.
-
-
Constructor Details
-
ImString
public ImString()Creates anImStringinstance withDEFAULT_LENGTHsize for the inner buffer. -
ImString
-
ImString
public ImString(int length) Creates anImStringinstance with provided size for the inner buffer.- Parameters:
length- size of the inner buffer to use
-
ImString
Creates anImStringinstance from provided string. Inner buffer size will be equal to the length of the string +CARET_LEN.- Parameters:
text- string to create a newImString
-
ImString
Create anImStringinstance from provided string with custom size for the inner buffer.- Parameters:
text- string to a creation a newImStringlength- custom size for the inner buffer
-
-
Method Details
-
get
-
getData
public byte[] getData() -
set
-
set
-
set
-
set
-
set
-
set
-
resize
public void resize(int newSize) -
getLength
public int getLength()Get the length of the text inside the data buffer.- Returns:
- length of the text inside the data buffer
-
getBufferSize
public int getBufferSize()Get the size of the data buffer. Buffer size will always have '+1' to its size, since it's used by the Dear ImGui to draw a caret char.- Returns:
- size of the data buffer
-
isEmpty
public boolean isEmpty()- Returns:
- true if the length of the text inside the data buffer is 0
-
isNotEmpty
public boolean isNotEmpty()- Returns:
- true if the length of the text inside the data buffer is not 0
-
clear
public void clear()Clears underlying string by setting empty value. -
toString
-
equals
-
hashCode
public int hashCode() -
clone
-
compareTo
- Specified by:
compareToin interfaceComparable<ImString>
-