Update API documentation and remove obsolete plan files
This commit is contained in:
@@ -1,35 +1,18 @@
|
||||
# RectInt::GetPosition
|
||||
|
||||
```cpp
|
||||
Vector2 GetPosition() const;
|
||||
Vector2 GetPosition() const
|
||||
```
|
||||
|
||||
获取矩形位置(x, y 坐标)。
|
||||
获取矩形左上角位置(转换为浮点)。
|
||||
|
||||
**返回:** 表示矩形位置的 Vector2(转换为浮点)
|
||||
|
||||
**线程安全:** ✅
|
||||
**返回:** `Vector2` - 位置向量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Rect.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
int main() {
|
||||
RectInt rect(10, 20, 100, 50);
|
||||
Vector2 pos = rect.GetPosition();
|
||||
std::cout << "Position: (" << pos.x << ", " << pos.y << ")\n";
|
||||
return 0;
|
||||
}
|
||||
RectInt rect(10, 20, 100, 50);
|
||||
Vector2 pos = rect.GetPosition(); // (10.0f, 20.0f)
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [`RectInt::GetSize`](getsize.md) - 获取尺寸
|
||||
- [`RectInt::GetCenter`](getcenter.md) - 获取中心点
|
||||
- [RectInt 总览](rectint.md)
|
||||
Reference in New Issue
Block a user