A size, which has width and height, could be used to represent the size in 2D. More...
Public Member Functions | |
operator Vec2 () const | |
Conversion from Vec2 to Size. | |
Size () | |
Constructor. | |
Size (float width, float height) | |
Constructor. More... | |
Size (const Size &other) | |
Constructor. | |
Size (const Vec2 &point) | |
Constructor. More... | |
Size & | operator= (const Size &other) |
assign another value to this. | |
Size & | operator= (const Vec2 &point) |
assign another Vec2 value to this. More... | |
Size | operator+ (const Size &right) const |
add another Size to this. | |
Size | operator- (const Size &right) const |
substract another Size to this. | |
Size | operator* (float a) const |
scale the size by a. | |
Size | operator/ (float a) const |
shrink the size by a. | |
void | setSize (float width, float height) |
Set the width and height of Size. | |
bool | equals (const Size &target) const |
Check if two size is the same. | |
Public Attributes | |
float | width |
Width of the Size. | |
float | height |
Height of the Size. | |
Static Public Attributes | |
static const Size | ZERO |
Size(0,0). | |
A size, which has width and height, could be used to represent the size in 2D.
Size | ( | float | width, |
float | height | ||
) |
Constructor.
Width of the size. Height of the size.