Bitbybit Docs
    Preparing search index...

    Class BabylonGuiInputText

    Single-line text fields the user can type into, with a placeholder shown while empty. Subscribe to the text changed event to react to typing.

    Index

    Constructors

    create

    • Creates a text field holding text, showing placeholder while it is empty, in the given colors; sizes are pixel strings or fractions of the parent.

      Parameters

      • inputs: CreateInputTextDto

        The name, the text, the placeholder, the colors and the optional size

      Returns InputText

      The text field

      const input = bitbybit.babylon.gui.inputText.createInputText({ name: "label", text: "", placeholder: "Type a label", color: "#f0cebb", background: "black", width: "300px", height: "40px" });
      panel.addControl(input);
      input.onTextChangedObservable.add((field) => { console.log(field.text); });

    get

    • Reads the background color of a text field.

      Parameters

      Returns string

      The background color

    • Reads the text a text field currently holds, as typed by the user.

      Parameters

      Returns string

      The text

    • Reads the hint a text field shows while it is empty.

      Parameters

      Returns string

      The placeholder

    set

    • Sets the background color of a text field, as a CSS color.

      Parameters

      Returns InputText

      The same text field

    • Replaces the text a text field holds, which fires its text changed event like typing would.

      Parameters

      Returns InputText

      The same text field

    • Sets the hint a text field shows while it is empty.

      Parameters

      Returns InputText

      The same text field