Files
XCEngine/docs/api/math/rectint/getsize.md
2026-03-20 02:35:15 +08:00

35 lines
652 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# RectInt::GetSize
```cpp
Vector2 GetSize() const;
```
获取矩形尺寸width, height
**返回:** 表示矩形尺寸的 Vector2转换为浮点
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
#include "XCEngine/Math/Rect.h"
#include <iostream>
using namespace XCEngine::Math;
int main() {
RectInt rect(10, 20, 100, 50);
Vector2 size = rect.GetSize();
std::cout << "Size: (" << size.x << ", " << size.y << ")\n";
return 0;
}
```
## 相关文档
- [`RectInt::GetPosition`](getposition.md) - 获取位置
- [`RectInt::GetCenter`](getcenter.md) - 获取中心点
- [RectInt 总览](rectint.md)