Documentation > GUI > InputText

Parent du composant : Panel
Version: 2.0.4

Constructor InputText.new(X, Y, Width, Height, TextColor, FontName, FontSize, BorderColor, BackColor, MaxLength, PlaceHolder, PlacerHolderColor)

This function create a new instance of an ImputText object.

X

Position on the X axis of the text.

Y

Position on the Y axis of the text.

Width

Width of the space occupied by the text.

Height

Height of the space occupied by the text.

TextColor

Color of the text.

FontName

Name and path of the font file.

FontSize

Size of the text.

BorderColor

Color of the border.

BackColor

Color of the back

MaxLength

Number maximum of characters authorized.

PlaceHolder

Placeholder text (text to display when the content is empty).

PlaceHolderColor

Color of the placeholder text.

Return

New instance of an InputText object.

InputText:update(dt)

This function triggers the action for the pressed event and update the cursor if the inputtext has the focus and is visible.

dt

Delta time.

InputText:draw()

This function draw the input text if define as visible.

InputText:setFont(FontName, FontSize)

This function sets the font and size of the text. If the FontName is nil, no font is set. The width and height of the text are updated.

FontName

Path and name of the font to use to display the text. Should not be nil.

FontSize

Font size of the text.

InputText:setFontSize(Size)

This function changes the font size of the text. If no font has been set, the current text size will remain. The width and height of the text are updated.

Size

New font size.

InputText:setTextColor(Color)

This function set the color of the text and cursor.

Color

Color of the text and cursor.

InputText:setMaxLength(MaxLength)

This function defines the maximum number of characters which can contain the input text.

MaxLength

Maximum number of characters admitted.

InputText:setPlaceholder(Placeholder)

This function sets the place holder text with 50% of transparency.

Placeholder

Text of the place holder.

InputText:keyPressed(key)

This function add the pressed keys to the focused input text. Only alphabetical characters and ponctuation are authorized.

key

Key pressed.

InputText:toString(NoTitle)

This function display all variables containing in the current InputText instance (tables and functions are excluded).

NoTitle

Indicates if the title must be displayed (false) or not (true).