MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / string

Method string

include/Vector2.hpp:18–47  ·  view source on GitHub ↗

* Vector2 type */

Source from the content-addressed store, hash-verified

16 * Vector2 type
17 */
18class Vector2 : public ::Vector2 {
19public:
20 constexpr Vector2(const ::Vector2& vec) : ::Vector2{vec.x, vec.y} {}
21
22 constexpr Vector2(float x = 0, float y = 0) : ::Vector2{x, y} {}
23
24 GETTERSETTER(float, X, x)
25 GETTERSETTER(float, Y, y)
26
27 /**
28 * Set the Vector2 to the same as the given Vector2.
29 */
30 Vector2& operator=(const ::Vector2& vector2) {
31 set(vector2);
32 return *this;
33 }
34
35 /**
36 * Determine whether or not the vectors are equal.
37 */
38 constexpr bool operator==(const ::Vector2& other) const { return x == other.x && y == other.y; }
39
40 /**
41 * Determines if the vectors are not equal.
42 */
43 constexpr bool operator!=(const ::Vector2& other) const { return !(*this == other); }
44
45 RLCPP_NODISCARD std::string ToString() const { return TextFormat("Vector2(%f, %f)", x, y); }
46
47 operator std::string() const { return ToString(); }
48
49#ifndef RAYLIB_CPP_NO_MATH
50 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected