TMLoader Documentation
  • Overview
  • Libraries
    • loader
      • loader.thread
      • loader.il2cpp
        • Runtime
        • Thread
        • Class
        • Object
        • String
        • Array
      • loader.struct
  • User Interface Components
    • Slider
    • Switch
    • TextField
Powered by GitBook
On this page
  1. User Interface Components

TextField

A TextField UI element allows users to input text into a text box.

To add a textField UI element to your mod, use the utils.addTextField function. This function takes the following parameters:

utils.addTextField(section, key, title, defaultValue, description, placeholder)

The utils.addTextField function takes several parameters:

  • section is the UI section that the TextField should be added to.

  • key is a unique identifier for the TextField.

  • title is the title that will be displayed for the TextField.

  • defaultValue The default value of the TextField (optional).

  • descriptio A description of the textField (optional).

  • placeholder place holder text of the textField.

utils.addTextField(section, "textValKey", "TextField", "", "This is a text field", "Enter some text here")

You can access the current value of a TextField using the getValueForKey function:

local textFieldValue = getValueForKey("textValKey")

This will return the current value of the TextField with the textValKey identifier.

PreviousSwitch

Last updated 2 years ago