> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/ui_input_binding.md).

# UI 입력 바인딩

입력 동작을 직접 UI 요소에 연결하여 플레이어 입력을 처리하게 합니다.

`UiInputBinding` 모든 UI 요소를 컨트롤 버튼으로 바꿉니다. 요소를 하나 이상의 [`InputAction`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md#pointer-buttons)에 바인딩하면, 터치나 포인터로 누르고 있는 동안 해당 액션이 계속 눌린 상태가 되어 로컬 플레이어의 입력(이동, 점프)과 모든 씬 [`InputAction`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md#pointer-buttons) 리스너를 작동시킵니다. 기본 제공되는 화면 버튼과 똑같이 동작합니다.

이를 사용해 나만의 터치 컨트롤을 만들 수 있습니다. 일반적으로 [화면 컨트롤](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/touch-screen-controls.md)과 함께 사용합니다. 기본 버튼을 숨긴 다음, 그 자리에 직접 만든 버튼을 배치하세요.

<figure><img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-9124ebe50a4d4cd7ceae7b8f11b6efb34c6e25d8%2Fui-input-binding.webp?alt=media" alt="A retro-style gamepad assembled from custom UI elements, each wired to an input action"><figcaption><p>UI 요소로 만든 완전한 맞춤형 게임패드입니다. 각 버튼은 입력 액션에 바인딩된 UI 엔티티입니다.</p></figcaption></figure>

## UI 요소에 액션 바인딩하기

다음 속성을 `uiInputBinding` 의 요소에 추가하고 `.tsx` UI에서 누르고 있는 동안 유지할 액션을 나열합니다. 이 속성은 모든 UI 요소에서 사용할 수 있습니다([`UiEntity`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/onscreen-ui.md#ui-entities), [`Button`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/onscreen-ui.md#ui-entities), [`Label`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/onscreen-ui.md#ui-entities) 등). `uiTransform` 및 `uiBackground`.

**누르고 있는 동안 플레이어를 앞으로 이동시키는 버튼:**

```tsx
import { InputAction } from '@dcl/sdk/ecs'
import { Button } from '@dcl/sdk/react-ecs'

export const forwardButton = () => (
	<Button
		value="▲"
		uiTransform={{ width: 100, height: 100 }}
		uiInputBinding={{ actions: [InputAction.IA_FORWARD] }}
	/>
)
```

## 맞춤형 컨트롤 묶음 만들기

여러 바인딩 요소를 조합해 완전한 컨트롤 구성을 만드세요.

**이동 버튼과 `IA_PRIMARY`:**

```tsx
import { InputAction } from '@dcl/sdk/ecs'
import { Button, UiEntity } from '@dcl/sdk/react-ecs'

export const customControls = () => (
	<UiEntity uiTransform={{ width: 240, height: 120 }}>
		<Button
			value="▲"
			uiTransform={{ width: 100, height: 100 }}
			uiInputBinding={{ actions: [InputAction.IA_FORWARD] }}
		/>
		<Button
			value="사용"
			uiTransform={{ width: 100, height: 100 }}
			uiInputBinding={{ actions: [InputAction.IA_PRIMARY] }}
		/>
	</UiEntity>
)
```

바인딩된 액션은 기본 버튼과 똑같이 동작합니다. `IA_FORWARD` / `IA_BACKWARD` / `IA_LEFT` / `IA_RIGHT` 는 아바타를 이동시키며, 모든 액션은 씬의 [`InputAction`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md#pointer-buttons) 리스너에서 읽을 수 있습니다. 속성(또는 컴포넌트)을 제거하면 바인딩이 해제됩니다.

## 속성

| 속성        | 유형                                                                                                                                            | 설명                                                                                                                                                                                                                                                                                                              |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | 배열 [`InputAction`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md#pointer-buttons) | 이 요소를 누르고 있는 동안 유지되는 입력 동작입니다. 전체 [클릭 이벤트](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md) 목록은 [`InputAction`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md#pointer-buttons) 값에서 확인하세요. |

{% hint style="info" %}
이 기능을 [`TouchScreenControls`](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/touch-screen-controls.md) 와 함께 사용하면 기본 컨트롤을 숨기고 직접 만든 터치 UI로 대체할 수 있습니다. 완전히 사용자 지정한 컨트롤 구성을 제공할 때 권장되는 방법입니다.
{% endhint %}

## 관련 항목

* [화면 컨트롤](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/touch-screen-controls.md)
* [UI 버튼 이벤트](https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/ui_button_events.md)
* [모바일 입력](https://docs.decentraland.org/creator/content-creator-ko/build-for-mobile/develop/input-on-mobile.md)
* [클릭 이벤트](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/click-events.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-ko/sdk7/2d-ui/ui_input_binding.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
