UGDK
0.5.0
|
Represents a frame on the screen or an image. More...
#include <ugdk/math/frame.h>
Public Member Functions | |
Frame () | |
Creates an empty frame at (0, 0). More... | |
Frame (double _left, double _top, double _right, double _bottom) | |
Creates a frame with the given coordinates. More... | |
~Frame () | |
double | width () const |
Returns the width of the frame. More... | |
double | height () const |
Returns the height of the frame. More... | |
bool | Collides (const math::Frame &frame) const |
Returns whether this frame and the other frame are colliding. More... | |
Accessors and Mutators | |
void | set_left (double _left) |
void | set_top (double _top) |
void | set_right (double _right) |
void | set_bottom (double _bottom) |
double | left () const |
double | top () const |
double | right () const |
double | bottom () const |
Represents a frame on the screen or an image.
Represents a rectangular frame on the screen or an image. Useful for working with animations, collision detection, etc. left and top represent the frame's upper-left corner, while right and bottom represent the lower-right coordinates.
|
inline |
Creates an empty frame at (0, 0).
|
inline |
Creates a frame with the given coordinates.
left | The left margin |
top | The upper margin |
right | The right margin |
bottom | The lower margin |
|
inline |
|
inline |
bool ugdk::math::Frame::Collides | ( | const math::Frame & | frame | ) | const |
Returns whether this frame and the other frame are colliding.
|
inline |
Returns the height of the frame.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the width of the frame.