> For the complete documentation index, see [llms.txt](https://kap35.gitbook.io/kapui/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kap35.gitbook.io/kapui/user-manual/ui-elements/inputfield.md).

# InputField

## What is it ?

Inputfield is made to enter a text, numbers, email etc... really useful to interract with player if you need a text.

## How create it ?

You have to add InputField component in a [GameObject](https://kap35.gitbook.io/kap-engine-wiki/user-manual/gameobject). All component require will be added by the InputField.

Example :&#x20;

```cpp
auto inputFieldObject = scene.createScene("My Button");

auto inputField = std::make_shared<KapEngine::UI::Inputfield>(inputFieldObject);
inputFieldObject->addComponent(inputField);
```

## Functions

* setPlaceholderText : set the text of placeholder (text display when there is no content)
* setInputType : set the type of input (to allow keys or not)
* setBackground : set an image in background of button

Example :&#x20;

```cpp
auto inputFieldObject = scene.createScene("My Button");

auto inputField = std::make_shared<KapEngine::UI::Inputfield>(inputFieldObject);
inputFieldObject->addComponent(inputField);

//call all available functions
inputField->setPlaceholderText("My placeholder...");

//at base InputType is set for text but you can change it like that :
KapEngine::UI::Inputfield::InputType type;
type = KapEngine::UI::Inputfield::InputType::PASSWORD;
inputField->setInputType(type);

inputField->setbackground("path/image.png", {0, 0, 100, 100});

```
