> ## 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.

# Throttle

> Throttle

# Throttle

Y 軸のみのジョイスティックの特殊バージョン。ドライビング ゲーム向けに設計されています。

## プロパティ

`type` - "throttle"

`axisUp` - *string*。コントロールの上部がマッピングされるトリガー。`"leftTrigger"` または `"rightTrigger"` のいずれかである必要があります。

`axisDown` - *string*。コントロールの下部がマッピングされるトリガー。`"leftTrigger"` または `"rightTrigger"` のいずれかである必要があります。

`relative` - *boolean*、*省略可*。スロットルが値を計算する方法を制御します。`true` の場合、値はユーザーの最初のタッチ位置に基づきます。`false` の場合、値はコントロールの中心点に基づきます。既定値は `true` です。

`sticky` - *boolean*、*省略可*。ユーザーがコントロールへのタッチをやめたときの動作を制御します。`true` の場合、スロットルは最後の値のままです。`false` の場合、0 にリセットされます。既定値は `false` です。

`enabled` - *boolean*、*省略可*。既定値は `true` です。コントロールの視覚的な状態を有効/無効に設定します。無効なコントロールは引き続きプレイヤーからの入力を受け取りますが、入力に基づいて視覚スタイルは *変更されません*。

`visible` - *boolean*、*省略可*。既定値は `true` です。プレイヤーが操作できるようにコントロールを表示するかどうかを決定します。ゲーム プレイ中にこれを変更するには、[ゲーム状態を使用したタッチ レイアウトの変更](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-changing-layouts-game-state.md#change_state) を参照してください。

`styles` - *object*、*省略可*。コントロールの視覚的表現のカスタマイズ。スタイルは、スタイル設定可能な状態ごとのオブジェクトとして表されます。

throttle コントロールは次の状態のスタイルを設定できます。

* `default` - 基本スタイル。
* `activated` - プレイヤーがノブに触れており、軸に沿ってちょうど 0 の値にあるときに適用されます。
* `activatedDown` - プレイヤーがノブに触れて、スロットル軸の負 (下側) の部分にノブを移動させたときに適用されます。
* `activatedUp` - プレイヤーがノブに触れて、スロットル軸の正 (上側) の部分にノブを移動させたときに適用されます。
* `idle` - プレイヤーがコントロールを操作しておらず、ノブが軸の上側部分で `sticky` になっていない場合に適用されます。
* `idleUp` - プレイヤーがコントロールを操作しておらず、ノブが上側の部分に移動され `sticky` が `true` に設定されている場合に適用されます。

**状態ごとのスタイル設定プロパティ**

`opacity` - *number*、*省略可*。コントロールに適用される不透明度。`disabled` を除くすべての状態で既定値は 1.0 です。

[`axisUp`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-throttle-axis) - *object*、*省略可*。スロットルの正 (上側) 部分のスタイルを指定する [`axis`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-throttle-axis) オブジェクト。

[`axisDown`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-throttle-axis) - *object*、*省略可*。スロットルの負 (下側) 部分のスタイルを指定する [`axis`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-throttle-axis) オブジェクト。

[`knob`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-knob) - *object*、*省略可*。スロットルのノブ部分のスタイルを指定する [`knob`](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-knob) オブジェクト。

`indicator` - *object*、*省略可*。ノブを軸上の現在位置に接続するコンポーネントに適用するスタイルを指定する [stroke](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-stroke)。

**アセットの寸法**

画像アセットを受け入れる各スタイル オブジェクトについて、指定されたアセットはベース解像度と、そのベース解像度の 1.5x、2.0x、3.0x、4.0x のスケールで提供されます。指定された画像の解像度は、次の最大解像度以下である必要があります。

| オブジェクト | @1.0x | @1.5x | @2.0x | @3.0x | @4.0x |
| :- | :- | :- | :- | :- | :- |
| knob.faceImage | 60x60 | 90x90 | 120x120 | 180x180 | 240x240 |
| knob.background | 60x60 | 90x90 | 120x120 | 180x180 | 240x240 |

## 補足

`throttle` コントロールを使用すると、プレイヤーはタッチ コントロールを使用してトリガーの可変圧力を提供できます。

`throttle` コントロールは、ホイールの中央スポットに配置され、そのスポットと画面の端の間の唯一のコントロールとなるよう設計されています。

プレイヤーが常に一定の圧力をトリガーに加えたいと思われる場合は `sticky` を true に設定し、値を設定してから他のアクションに指を使えるようにします。

**スタイル設定に関する補足**

> [!WARNING]
>
> Windows 版 Content Test Application 経由でストリーミングする場合、すべてのスタイル設定が正しく表示されるわけではありません。

## サンプル

#### 例 1: 基本的なスロットル

**図 1. スロットル コントロール**

![スロットルを操作するユーザー](https://mintcdn.com/microsoft-4404708b/gzrdvT5kpqAXKEQt/images/gdk/reference/game-streaming-touch-control-images-throttle.gif?s=effd39103fb6dd47dbe5275bdfc07426)

これは既定のスタイルを使用しています。

```JSON theme={null}
{
    "type": "throttle",
    "axisUp": "rightTrigger",
    "axisDown": "leftTrigger",
    "sticky": true
}
```

#### 例 2: スタイル付きの輪郭と明示的に定義されたアイコンを持つスロットル

**図 1. カスタマイズされたスロットル コントロール**

![カスタマイズされたスロットルを操作するユーザー](https://mintcdn.com/microsoft-4404708b/gzrdvT5kpqAXKEQt/images/gdk/reference/game-streaming-touch-control-images-throttle-customized.gif?s=bfccc19c022aed00a4e3e14833ab2202)

```JSON theme={null}
{
    "type": "throttle",
    "axisUp": "rightTrigger",
    "axisDown": "leftTrigger",
    "sticky": true,
    "styles": {
        "default": {
            "knob" : {
                "faceImage" : {
                    "type": "icon",
                    "value": "gasPedal"
                }
            },
            "axisUp": {
                "stroke" : {
                    "type": "solid",
                    "color":  "#107C10"
                },
                "cap" : {
                    "type": "color",
                    "value": "#107C10"
                }
            },
            "axisDown": {
                "stroke" : {
                    "type": "solid",
                    "color":  "#ff0000"
                },
                "cap" : {
                    "type": "color",
                    "value": "#ff0000"
                }
            }
        },
        "idleUp" : {
            "knob" : {
                "stroke" : {
                    "type": "solid",
                    "color":  "#107C10"
                }
            },
            "indicator" : {
                "type": "solid",
                "color":  "#107C10"
            }
        },
        "activatedUp" : {
            "indicator" : {
                "type": "solid",
                "color":  "#107C10"
            }
        },
        "activatedDown": {
            "knob" : {
                "faceImage" : {
                    "type": "icon",
                    "value": "brakePedal"
                }
            },
            "indicator" : {
                "type": "solid",
                "color":  "#ff0000"
            }
        }
    }
}
```

## 要件

**レイアウト バージョン:** 1.0 以上 (スタイル設定はレイアウト バージョン 3.2 以上で利用可能)


## Related topics

- [Best practices for the RTA service](https://devdocs.xbox.com/services/xbox-services/fundamentals/rta/concepts/live-rta-best-practices.md)
- [Title Storage overview](https://devdocs.xbox.com/services/xbox-services/storage/title-storage/live-title-storage-overview.md)
- [Fine-Grained Rate Limiting](https://devdocs.xbox.com/services/xbox-services/develop/best-practices/live-fine-grained-rate-limiting.md)
- [PlayFab Party 版本資訊](https://devdocs.xbox.com/zh-TW/services/playfab/multiplayer/networking/release-notes.md)
- [PlayFab Party Release Notes](https://devdocs.xbox.com/services/playfab/multiplayer/networking/release-notes.md)
