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

# Layer

> Layer (Experimental)

# Layer (Experimental)

可叠加在基础触控布局之上的子触控布局。

> [!WARNING]
>
> 层目前以实验形式提供，可能会根据早期使用者的反馈更改其行为。

## 属性

命名的层对象包含以下属性。

`center` - *object*，*可选*。显示在屏幕中央的控件[轮盘](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-wheel)。

`left` - *object*，*可选*。默认显示在玩家左手/拇指下的控件[轮盘](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-wheel)。

`lower` - *object*，*可选*。允许你将控件放置在下部控件行中三个 `leftCenter`、`center` 或 `rightCenter` 位置中任一位置的对象。

`right` - *object*，*可选*。默认显示在玩家右手/拇指下的控件[轮盘](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-wheel)。

`upper` - *object*，*可选*。允许你在上部控件行的 `right` 位置放置一组控件的对象。

## 备注

使用 `layer` 时，在正常布局中通常放置 `control` 的每个位置（`center`、`left`、`lower`、`right`、`upper` 位置），你可以放入一个控件来替换之前显示的控件，或使用[`blank`](/zh-CN/reference/system/touchadaptationkit/controls/game-streaming-touch-blank) 控件来隐藏之前在该位置显示的控件。

要显示 `layer`，你必须有一个具有[层操作](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-layer-action) 的[`button`](/zh-CN/reference/system/touchadaptationkit/controls/game-streaming-touch-button) 控件，用于触发布局显示。

## 示例

此示例从一个简单的平台游戏布局开始，右上角有一个按钮，用于切换显示包含高级能力的层。

![玩家与布局交互并使用层显示其他控件](https://mintcdn.com/microsoft-4404708b/gzrdvT5kpqAXKEQt/images/gdk/reference/game-streaming-touch-control-images-layer-special-ability.gif?s=75cb7f41bedfbe02eb6548681a548576)

```JSON theme={null}
{
    "$schema": "https://raw.githubusercontent.com/microsoft/xbox-game-streaming-tools/main/touch-adaptation-kit/schemas/layout/v3.1/layout.json",
    "content": {
        "left": {
            "inner": [
                {
                    "type": "directionalPad",
                    "scale": 1.5
                }
            ]
        },
        "right": {
            "inner": [
                {
                    "type": "button",
                    "action": "gamepadY",
                    "styles": {
                        "default": {
                            "faceImage": {
                                "type": "icon",
                                "value": "dash"
                            }
                        }
                    }
                },
                {
                    "type": "button",
                    "action": "gamepadA",
                    "styles": {
                        "default": {
                            "faceImage": {
                                "type": "icon",
                                "value": "jump"
                            }
                        }
                    }
                }
            ],
            "outer": [
                null,
                {
                    "type": "button",
                    "action": "gamepadB",
                    "styles": {
                        "default": {
                            "faceImage": {
                                "type": "icon",
                                "value": "specialAbility"
                            }
                        }
                    }
                },
                null,
                null,
                {
                    "type": "button",
                    "action": "gamepadX",
                    "styles": {
                        "default": {
                            "faceImage": {
                                "type": "icon",
                                "value": "fire"
                            }
                        }
                    }
                }
            ]
        },
        "upper": {
            "right": [
                {
                    "type": "button",
                    "action": {
                        "type": "layer",
                        "target": "selectAbility"
                    },
                    "styles": {
                        "default": {
                            "faceImage": {
                                "type": "icon",
                                "value": "add"
                            }
                        }
                    },
                    "toggle" : true
                },
                {
                    "type": "button",
                    "action": "view"
                },
                {
                    "type": "button",
                    "action": "menu"
                }
            ]
        },
        "layers": {
            "selectAbility": {
                "right": {
                    "outer": [
                        null,
                        null,
                        null,
                        null,
                        null,
                        null,
                        {
                            "type": "button",
                            "action": "rightBumper",
                            "styles": {
                                "default": {
                                    "faceImage": {
                                        "type": "icon",
                                        "value": "ability2"
                                    }
                                }
                            }
                        },
                        {
                            "type": "button",
                            "action": "leftBumper",
                            "styles": {
                                "default": {
                                    "faceImage": {
                                        "type": "icon",
                                        "value": "ability"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        }
    }
}

```

## 另请参阅

[Touch Adaptation Kit 参考](/zh-CN/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-kit-overview.md)\
[Blank 控件](/zh-CN/reference/system/touchadaptationkit/controls/game-streaming-touch-blank)\
[Layer 操作](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-layer-action)\
[Layout](/zh-CN/reference/system/touchadaptationkit/layout/game-streaming-touch-layout)


## Related topics

- [ClearUnorderedAccessViewFloat](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_clearunorderedaccessviewfloat_public.md)
- [ClearUnorderedAccessViewUint](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_clearunorderedaccessviewuint_public.md)
- [WinHTTP overview](/build/console-features/networking/web-requests/intro-winhttp.md)
- [WinHTTP 概述](/zh-CN/build/console-features/networking/web-requests/intro-winhttp.md)
- [Visão geral do WinHTTP](/pt-BR/build/console-features/networking/web-requests/intro-winhttp.md)
