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

# XGameStreamingHideTouchControls

> XGameStreamingHideTouchControls

# XGameStreamingHideTouchControls

请求所有已连接的流式处理客户端设备隐藏触摸布局（如果它们可见）。

## 语法

```cpp theme={null}
void XGameStreamingHideTouchControls();
```

### 返回值

类型：void

## 备注

此 API 请求所有已连接的游戏流式处理客户端移除任何已显示的触摸叠加控件。如果玩家未在流式播放游戏，或者他们正在流式传输到未显示触摸叠加控件的设备，则此函数不执行任何操作。

若要显示特定的触摸控件布局，请调用 [XGameStreamingShowTouchControlLayout](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayout)。

每次调用 `XGameStreamingHideTouchControls` 都会导致通过网络发送一条消息，因此不应每帧调用它。而是仅当游戏需要转换到不再在屏幕上显示触摸控件时才调用此 API。

如果游戏需要在**特定**的已连接流式处理客户端设备上隐藏触摸控件布局，请考虑改用 [XGameStreamingHideTouchControlsOnClient](/reference/system/xgamestreaming/functions/xgamestreaminghidetouchcontrolsonclient)。

## 示例

```cpp theme={null}
void OnShowMenu()
{
    // This game has native touch support for the menu system, so hide touch overlay controls
    XGameStreamingHideTouchControls();
}

void OnDismissMenu()
{
    // Show the touch overlay controls which were previously on the screen before we hid them
    // due to bringing up the menu.
    XGameStreamingShowTouchControlLayout(m_currentTouchLayout);
}
```

## 要求

**标头：** xgamestreaming.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XGameStreamingShowTouchControlLayout](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayout)\
[XGameStreamingHideTouchControlsOnClient](/reference/system/xgamestreaming/functions/xgamestreaminghidetouchcontrolsonclient)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members#TouchAdaptation)


## Related topics

- [XGameStreamingHideTouchControlsOnClient](/zh-CN/reference/system/xgamestreaming/functions/xgamestreaminghidetouchcontrolsonclient.md)
- [XGameStreamingShowTouchControlLayout](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayout.md)
- [根据游戏状态更改触控布局](/zh-CN/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-changing-layouts-game-state.md)
- [XGameStreaming](/zh-CN/reference/system/xgamestreaming/xgamestreaming_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
