Files
XCEngine/docs/api/XCEngine/Input/InputManager/GetTouchCount.md

27 lines
495 B
Markdown
Raw Normal View History

2026-03-26 16:45:24 +08:00
# InputManager::GetTouchCount
2026-03-26 17:39:53 +08:00
读取当前已保存的触点数量。
2026-03-26 16:45:24 +08:00
```cpp
int GetTouchCount() const;
```
2026-03-26 17:39:53 +08:00
## 行为说明
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
当前实现直接返回 `m_touches.size()`。因为现有公开代码路径没有填充触摸状态,所以在当前版本里它通常为 `0`
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
## 返回值
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
- `int` - 当前触点数量。
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
## 示例
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
```cpp
int count = XCEngine::Input::InputManager::Get().GetTouchCount();
2026-03-26 16:45:24 +08:00
```
## 相关文档
2026-03-26 17:39:53 +08:00
- [返回类型总览](InputManager.md)
- [GetTouch](GetTouch.md)