> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create コマンドの概要

> Create コマンド

`create` コマンドは、タッチ アダプテーション バンドル (または、略してアンパック済みバンドル) のソース コンテンツを作成したり、既存のアンパック済みバンドルに新しいレイアウトを追加したりするために使用されます。
これは、ゲームへのタッチ適応の追加を始めるための素早いエントリー ポイントとなります。

以下の表は、`create` コマンドで使用可能な各種サブコマンドを示しています。`create` コマンド自体を単独で使用することはできず、サブコマンドを指定する必要があります。

| サブコマンド | 説明 |
| - | - |
| [`bundle`](#create-bundle) | 開発用の新しいアンパック タッチ アダプテーション バンドルを作成します |
| [`layout`](#create-layout) | 既存のアンパック タッチ アダプテーション バンドル内に、テンプレートに基づく新しいレイアウトを作成します |

## Create Bundle

`create bundle` サブコマンドは、新しいタッチ アダプテーション バンドルに必要なすべてのソース コンテンツを迅速に作成します。ゲームに既存のアンパック済みバンドルがない場合、タッチ アダプテーションの出発点になります。

新しいバンドルを始めるのに必要なすべてのディレクトリとファイルを作成します。これには、さまざまな言語のための JSON レイアウト ファイルを含むルート [layouts](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-bundle.md#layouts) ディレクトリ、言語ごとのさまざまな DPI 用アセットを含むルート [assets](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-bundle.md#assets) ディレクトリ、バンドルを記述するルート バンドル[構成](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-bundle.md#configuration) ファイル (`takxconfig.json`)、および動的レイアウト状態と再利用可能なレイアウト定義用の空の[コンテキスト](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-bundle.md#context) ファイルが含まれます。

### オプション

以下の表のオプションを使用して、アンパックされたタッチ アダプテーション バンドルの作成を構成します。

| オプション | 説明 |
| - | - |
| `--destination` `--name` | 必須。アンパック バンドルを配置する宛先パス。単純な名前でも、フル パスでも指定できます。  \[!NOTE] 宛先にファイルやディレクトリが存在する場合、それらを最初に削除するには `--overwrite-destination` オプションを使用する必要があります。  \[!NOTE] パスの代わりに単純な名前が使用される場合、現在の作業ディレクトリに作成されたバンドルが配置されます。 |
| `--layouts-directory-name` `--layouts-dir` `--layouts` | タッチ操作レイアウトを格納するサブディレクトリの名前。これはルートの layouts ディレクトリです。 デフォルト: `layouts`。 |
| `--assets-directory-name` `--assets-dir` `--assets` | タッチ操作アセットを格納するサブディレクトリの名前。これはルートの assets ディレクトリです。 デフォルト: `assets`。 |
| `--layout-languages` | ルート layouts ディレクトリの下に言語ディレクトリを作成するために使用する IETF 言語タグのリスト。`neutral` は常に作成されます。 デフォルト: 空のリスト。 |
| `--asset-languages` | ルート assets ディレクトリの下に言語ディレクトリを作成するために使用する IETF 言語タグのリスト。`neutral` は常に作成されます。 デフォルト: 空のリスト。 |
| `--version` | バンドルのコンテンツ バージョン。 デフォルト: `1.0.0.0`。 |
| `--version-name` | バンドルのコンテンツ バージョンの名前。 デフォルト: 空の文字列。 |
| `--context-file-name` `--context-file` `--context` | バンドルのコンテキスト ファイルの名前。 デフォルト: `context.json`。 |
| `--templates` | 作成時にバンドルに追加する 1 つ以上のテンプレート レイアウトのリスト。テンプレートは常に `neutral` レイアウト言語ディレクトリに追加され、加えて `--layout-languages` で指定された言語に対応する言語ディレクトリにも追加されます。 [利用可能なテンプレートのリストを見る。](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-templates.md) デフォルト: `Blank`。 |
| `--no-templates` | バンドルにテンプレートを追加しません。`--templates` が指定されている場合は使用できません。 デフォルト: `false`。 |
| `--overwrite-destination` `--overwrite` | 宛先の以前のコンテンツを削除します。宛先が空でない場合、これは必須です。 デフォルト: `false`。 |

### 例

以下の例は、新しいアンパック タッチ アダプテーション バンドルを作成する方法を示しています。

***

デフォルトの blank テンプレートで、シンプルな新しいアンパック バンドルを作成します

```
D:\CreateBundleExamples> tak create bundle --name SampleBundle
Creating loose touch adaptation bundle 'SampleBundle'.
Creating bundle config file.
Creating layouts and assets directories.
Creating language directories.
Creating context file.
Added 1 templates to bundle.
Created loose touch adaptation bundle at 'D:\CreateBundleExamples\SampleBundle'.
```

出力:

```
D:.
└───CreateBundleExamples
    └───SampleBundle
        │   context.json
        │   takxconfig.json
        │
        ├───assets
        │   └───neutral
        │       ├───@1.0x
        │       ├───@1.5x
        │       ├───@2.0x
        │       ├───@3.0x
        │       └───@4.0x
        └───layouts
            └───neutral
                    blank.json
```

***

異なるドライブに、レイアウト言語、テンプレート、カスタム ディレクトリ名を指定して新しいバンドルを作成します

```
C:\> tak create bundle --destination D:\CreateBundleExamples\SomeFolder\AnotherFolder\SampleBundle --layout-languages fr fr-FR en-US --templates Menu Cinematic RacingBasic RacingAdvanced --layouts-dir touch-control-layouts --assets-dir touch-control-assets --context-file touch-control-context
Creating loose touch adaptation bundle 'SampleBundle'.
Creating bundle config file.
Creating layouts and assets directories.
Creating language directories.
Creating context file.
Added 4 templates to bundle.
Created loose touch adaptation bundle at 'D:\CreateBundleExamples\SomeFolder\AnotherFolder\SampleBundle'.
```

出力:

```
D:.
└───CreateBundleExamples
    └───SomeFolder
        └───AnotherFolder
            └───SampleBundle
                │   takxconfig.json
                │   touch-control-context.json
                │
                ├───touch-control-assets
                │   └───neutral
                │       ├───@1.0x
                │       ├───@1.5x
                │       ├───@2.0x
                │       ├───@3.0x
                │       └───@4.0x
                └───touch-control-layouts
                    ├───en
                    │   └───en-US
                    │           cinematic.json
                    │           menu.json
                    │           racing-advanced.json
                    │           racing-basic.json
                    │
                    ├───fr
                    │   │   cinematic.json
                    │   │   menu.json
                    │   │   racing-advanced.json
                    │   │   racing-basic.json
                    │   │
                    │   └───fr-FR
                    │           cinematic.json
                    │           menu.json
                    │           racing-advanced.json
                    │           racing-basic.json
                    │
                    └───neutral
                            cinematic.json
                            menu.json
                            racing-advanced.json
                            racing-basic.json
```

> [!NOTE]
>
> コマンドで --layout-languages オプションで 'fr' と 'fr-FR' の両方を指定すると、それぞれの対応するディレクトリにテンプレートが追加されます。ただし、'en-US' のみが指定されているため、テンプレートは 'en-US' ディレクトリにのみ追加され、親の 'en' ディレクトリには追加されません。これらの指定に関係なく、テンプレートは常に neutral ディレクトリに追加されます。

生成されるバンドル構成ファイル (`takxconfig.json`) には、`create bundle` コマンドに渡されたパラメーターを反映した構成が含まれます。

```json theme={null}
{
  "$schema": "https://raw.githubusercontent.com/microsoft/xbox-game-streaming-tools/main/touch-adaptation-kit/schemas/takxconfig/v1/takxconfig.json",
  "layouts": {
    "path": "touch-control-layouts"
  },
  "assets": {
    "path": "touch-control-assets"
  },
  "context": {
    "path": "touch-control-context.json"
  },
  "version": "1.0.0.0",
  "versionName": "Initial"
}
```

***

## Create Layout

`create layout` サブコマンドは、既存のアンパック バンドルに新しいレイアウトを追加できるようにします。[`create bundle`](#create-bundle) の出力は、アンパック バンドルのルートに作成された `takxconfig.json` ファイルを `--takx-config-file` オプションの値として提供することで、`create layout` の入力として使用できます。

[`create bundle`](#create-bundle) と同様に、このコマンドではレイアウトの作成にテンプレートを使用でき、デフォルトは `Blank` です。複数のレイアウト言語ディレクトリへのレイアウトの追加もサポートされ、ファイルが存在しない場合や `--overwrite` が必要となる場合の同様のルールが適用されます。

### オプション

以下の表のオプションを使用して、アンパック タッチ アダプテーション バンドル内のレイアウト作成を構成します。

| オプション | 説明 |
| - | - |
| `--takx-config-file` `--takxconfig` | 必須。バンドル構成ファイルへのパス。`takxconfig.json` という名前でなければなりません。 |
| `--name` | レイアウトの名前。これはファイル名にもなります。 レイアウトはゲームに最適な名前にすることをお勧めします。 デフォルト: 使用されるテンプレートの名前 (例: `shooter-basic.json`)。 |
| `--languages` | レイアウトを追加する対象の IETF 言語タグのリスト。ここで渡される値に関係なく、レイアウトは常に `neutral` レイアウト言語ディレクトリに追加されます。ここで指定された言語タグに対し、ルート layouts ディレクトリの下に一致するディレクトリが見つからない場合、そのディレクトリが作成されます。 デフォルト: 空のリスト。 |
| `--all-languages` `--all` | バンドル構成ファイル (`takxconfig.json`) で指定されたルート layouts ディレクトリの下に見つかったすべての言語サブディレクトリにレイアウトを作成します。 `--languages` が指定されている場合は `true` に設定できません。 デフォルト: `false` |
| `--template` | レイアウトに使用するテンプレート。 [利用可能なテンプレートのリストを見る。](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-templates.md) デフォルト: `Blank` |
| `--overwrite` | 同名の既存のレイアウト ファイルを上書きします。 ルート layouts ディレクトリ下の言語サブディレクトリのいずれかに同名の JSON ファイルが含まれる場合、これは必須です。たとえば、`--name` が `test` で、`--languages` が `en-US` に設定されており、`en-US` ディレクトリに `test.json` ファイルが含まれておらず、`neutral` には含まれている場合、`--overwrite` が指定されないとコマンドは実行されません。 デフォルト: `false` |
| `--set-default` `--default` | 作成したレイアウトを、バンドル構成ファイル (`takxconfig.json`) 内でデフォルト レイアウトとして設定します。 デフォルト: `false` |

### 例

以下の例は、既存のアンパック タッチ アダプテーション バンドルに新しいレイアウトを作成する方法を示しています。

***

デフォルトの `Blank` テンプレートを使用して、シンプルな新しいレイアウトを作成します。

```
D:\CreateLayoutExamples\SampleBundle> tak create layout --name sample-layout --takxconfig .\takxconfig.json
Verifying bundle configuration file (takxconfig.json).
Verification complete. 0 error(s), 0 warning(s) and 0 note(s) found.
Created layout 'sample-layout' using template 'Blank' in 1 directories.
```

出力:

```
D:.
└───CreateLayoutExample
    └───SampleBundle
        │   context.json
        │   takxconfig.json
        │
        └───layouts
            └───neutral
                    sample-layout.json
```

***

バンドル内の複数の言語に対して特定のテンプレートを使用して新しいレイアウトを作成します。

```
D:\CreateLayoutExamples> tak create layout --takxconfig .\SampleBundle\takxconfig.json --template ShooterBasic --languages ja-JP en en-US
Verifying bundle configuration file (takxconfig.json).
Verification complete. 0 error(s), 0 warning(s) and 0 note(s) found.
WARNING: A language directory for 'ja-JP' does not exist under the root layouts directory. It will be created, as well as any relevant parenting directories if applicable to the language.
WARNING: A language directory for 'en' does not exist under the root layouts directory. It will be created, as well as any relevant parenting directories if applicable to the language.
WARNING: A language directory for 'en-US' does not exist under the root layouts directory. It will be created, as well as any relevant parenting directories if applicable to the language.
Created layout 'shooter-basic' using template 'ShooterBasic' in 4 directories.
```

出力:

```
D:.
└───CreateLayoutExample
    └───SampleBundle
        │   context.json
        │   takxconfig.json
        │
        └───layouts
            ├───en
            │   │   shooter-basic.json
            │   │
            │   └───en-US
            │           shooter-basic.json
            │
            ├───ja
            │   └───ja-JP
            │           shooter-basic.json
            │
            └───neutral
                    shooter-basic.json
```

> [!NOTE]
>
> '--languages' パラメーターに指定されたのは前者のみだったため、レイアウトは 'en' ディレクトリに作成されましたが、'ja' ディレクトリには作成されませんでした。

***

すべての言語に対して新しいレイアウトを作成します

```
D:\CreateLayoutExamples> tak create layout --takxconfig .\SampleBundle\takxconfig.json --all-languages
Verifying bundle configuration file (takxconfig.json).
Verification complete. 0 error(s), 0 warning(s) and 0 note(s) found.
Created layout 'blank' using template 'Blank' in 5 directories.
```

出力:

```
D:.
└───SampleBundle
    │   context.json
    │   takxconfig.json
    │
    └───layouts
        ├───en
        │   │   blank.json
        │   │   shooter-basic.json
        │   │
        │   └───en-US
        │           blank.json
        │           shooter-basic.json
        │
        ├───ja
        │   │   blank.json
        │   │
        │   └───ja-JP
        │           blank.json
        │           shooter-basic.json
        │
        └───neutral
                blank.json
                shooter-basic.json
```

***

## 関連項目

[Touch Adaptation Kit Command Line Tool (tak.exe)](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line.md)


## Related topics

- [コマンド ライン ツールの概要 (tak.exe)](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line.md)
- [Linux ビルドの作成とデプロイ](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/servers/deploying-linux-based-builds.md)
- [XAPU の概要](https://docs.xbox.com/ja-jp/build/console-features/audio/overviews/xapu-overview.md)
- [XDSP の概要](https://docs.xbox.com/ja-jp/build/console-features/audio/overviews/xdsp-overview.md)
- [SHAPE の概要](https://docs.xbox.com/ja-jp/build/console-features/audio/overviews/shape-overview.md)
