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

655 B
Raw Blame History

RectInt::GetPosition

Vector2 GetPosition() const;

获取矩形位置x, y 坐标)。

返回: 表示矩形位置的 Vector2转换为浮点

线程安全:

复杂度: O(1)

示例:

#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;
}

相关文档