> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.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) | 既存のアンパック タッチ アダプテーション バンドル内に、テンプレートに基づく新しいレイアウトを作成します |

<a id="create-bundle" />

## Create Bundle

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

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

<a id="create-bundle-options" />

### オプション

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

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

<a id="create-bundle-examples" />

### 例

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

***

デフォルトの 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 ディレクトリに追加されます。</Note>

生成されるバンドル構成ファイル (`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"
}
```

***

<a id="create-layout" />

## Create Layout

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

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

<a id="create-layout-options" />

### オプション

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

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

<a id="create-layout-examples" />

### 例

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

***

デフォルトの `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' ディレクトリには作成されませんでした。</Note>

***

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

```
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)](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line)


## Related topics

- [Touch Adaptation Kit (TAK) コマンド ライン ツール リファレンス](/ja-jp/build/core-features/common/game-streaming/tak-command-line-tool/index.md)
- [2D プラットフォーマー用タッチ操作レイアウト](/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/samples/game-streaming-touch-tak-sample-platformer.md)
- [ドライビング用タッチ操作レイアウト](/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/samples/game-streaming-touch-tak-sample-driving.md)
- [格闘ゲーム用タッチ操作レイアウト](/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/samples/game-streaming-touch-tak-sample-fighter.md)
- [ファースト パーソン シューティング用タッチ操作レイアウト](/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/samples/game-streaming-touch-tak-sample-first-person.md)
