652 B
652 B
RectInt::GetSize
Vector2 GetSize() const;
获取矩形尺寸(width, height)。
返回: 表示矩形尺寸的 Vector2(转换为浮点)
线程安全: ✅
复杂度: O(1)
示例:
#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- 获取位置RectInt::GetCenter- 获取中心点- RectInt 总览