Create コマンド
create
コマンドは、タッチ アダプテーション バンドルのソース コンテンツ (または、略して展開済みバンドル) を作成したり、既存の展開済みバンドルに新しいレイアウトを追加したりするために使用されます。
これは、タッチ アダプテーションをゲームに追加するための簡単な入門的説明です。
次の表に、create
コマンドで使用可能なさまざまなサブ コマンドを示します。
create
コマンドは単独では使用できず、サブ コマンドを指定する必要があることに注意してください。
サブコマンド | 説明 |
---|---|
bundle |
開発用に新しい展開済みタッチ アダプテーション バンドルを作成する |
layout |
既存の展開済みタッチ アダプテーション バンドル内のテンプレートに基づいて新しいレイアウトを作成する |
バンドルの作成
create bundle
サブ コマンドを使用すると、新しいタッチ アダプテーション バンドルに必要なすべてのソース コンテンツをすばやく作成できます。 ゲームのために既存の展開済みバンドルが存在しない場合は、タッチアダプテーションの出発点となります。
新しいバンドルを開始するために必要なすべてのディレクトリとファイルが作成されます。 これには、さまざまな言語の JSON レイアウト ファイルが格納されているルート レイアウト ディレクトリ、言語ごとのさまざまな DPI のアセットが格納されているルート アセット ディレクトリ、バンドルを記述するルート バンドル構成ファイル (takxconfig.json
)、動的レイアウト状態と再利用可能なレイアウト定義の空のコンテキスト ファイルが含まれています。
オプション
次の表のオプションを使用して、展開済みタッチ アダプテーション バンドルの作成を構成します。
オプション | 説明 |
---|---|
--destination --name |
必須。 展開済みバンドルを配置する宛先パスです。 単純な名前または完全なパスを指定できます。 宛先にファイルまたはディレクトリが存在する場合は、最初に --overwrite-destination オプションを使用してそれを削除する必要があります。パスの代わりに単純な名前が使用された場合、作成されたバンドルは現在の作業ディレクトリに格納されます。 |
--layouts-directory-name --layouts-dir --layouts |
タッチ コントロール レイアウトを格納するサブディレクトリの名前です。 これはルート レイアウト ディレクトリです。 既定値: layouts 。 |
--assets-directory-name --assets-dir --assets |
タッチ コントロール アセットを格納するサブディレクトリの名前です。 これはルート アセット ディレクトリです。 既定値: assets 。 |
--layout-languages |
ルート レイアウト ディレクトリの下の言語ディレクトリの作成に使用する IETF 言語タグの一覧です。
neutral は常に作成されます。既定値: 空のリスト。 |
--asset-languages |
ルート アセット ディレクトリの下の言語ディレクトリの作成に使用する IETF 言語タグの一覧です。
neutral は常に作成されます。既定値: 空のリスト。 |
--version |
バンドルのコンテンツ バージョン。 既定値: 1.0.0.0 。 |
--version-name |
バンドルのコンテンツ バージョンの名前。 既定値: 空の文字列。 |
--context-file-name --context-file --context |
バンドルのコンテキスト ファイルの名前。 既定値: context.json 。 |
--templates |
作成時にバンドルに追加する 1 または複数のテンプレート レイアウトの一覧です。 テンプレートは常に neutral レイアウト言語ディレクトリおよび --layout-languages で指定された言語に対応する言語ディレクトリに追加されます。使用可能なテンプレートの一覧を表示します。 既定値: Blank 。 |
--no-templates |
バンドルにテンプレートを追加しません。
--templates が指定されている場合は使用できません。既定値: false 。 |
--overwrite-destination --overwrite |
宛先にある以前のコンテンツをすべて削除します。 宛先が空でない場合は必須です。 既定値: false 。 |
例
以下の例で、新しい展開済みタッチ アダプテーション バンドルを作成する方法を示します。
既定の空のテンプレートを使用して単純な新しい展開済みバンドルを作成する
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
注意
コマンドで、--layout-languages オプションを使用して 'fr' と 'fr-FR' の両方を指定すると、対応する各ディレクトリにテンプレートが追加されます。 ただし、'en-US' のみが指定されているため、テンプレートは 'en-US' ディレクトリにのみ追加され、親の 'en' ディレクトリには追加されません。 テンプレートは、これらの仕様に関係なく、一貫してニュートラル ディレクトリに追加されます。
生成されるバンドル構成ファイル (takxconfig.json
) には、create bundle
コマンドに渡されるパラメーターを表す構成が反映されます。
{
"$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 bundle
によって生成される出力は、展開済みバンドルのルートで作成された takxconfig.json
ファイルを --takx-config-file
オプションの値として指定することで、create layout
の入力として使用できます。
create bundle
と同様に、このコマンドでレイアウトの作成にテンプレートを使用することも、既定値の Blank
にすることもできます。 複数のレイアウト言語ディレクトリへのレイアウトの追加もサポートされており、ファイルが存在しない場合に関して、または --overwrite
が必須であることに関して、同じ規則も適用されます。
オプション
次の表のオプションを使用して、展開済みタッチ アダプテーション バンドルにおけるレイアウトの作成を構成します。
オプション | 説明 |
---|---|
--takx-config-file --takxconfig |
必須。 バンドル構成ファイルへのパスです。 名前を takxconfig.json にする必要があります。 |
--name |
レイアウトの名前です。 これはファイル名でもあります。 レイアウトには、ゲームに最適な名前を付けすることをお勧めします。 既定値: 使用されるテンプレートの名前 (例: shooter-basic.json )。 |
--languages |
レイアウトを追加する必要がある IETF 言語タグの一覧です。 ここで渡される値に関係なく、レイアウトは常に neutral レイアウト言語ディレクトリに追加されます。 ここで言語タグを指定したものの、ルート レイアウト ディレクトリの下にそれに一致するディレクトリが見つからない場合、ディレクトリが作成されます。既定値: 空のリスト。 |
--all-languages --all |
バンドル構成ファイル (takxconfig.json ) で指定されたルート レイアウト ディレクトリの下にあるすべての言語サブディレクトリ内にレイアウトを作成します。--languages が指定されている場合は true に設定できません。既定値: false |
--template |
レイアウトに使用するテンプレート。 使用可能なテンプレートの一覧を表示します。 既定値: Blank |
--overwrite |
既存のレイアウト ファイルを同じ名前で上書きします。 ルート レイアウト ディレクトリの下のいずれかの言語サブディレクトリに同じ名前の JSON ファイルが含まれている場合は必須です。 たとえば、 --name が test で、--languages が en-US に設定されていて、en-US ディレクトリに neutral は含まれているものの test.json という名前のファイルが含まれていない場合、--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
注意
レイアウトは 'en' ディレクトリに確立されましたが、'-languages' パラメーターに指定されたのは前者だけのため、'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