1 #ifndef UGDK_MATH_FRAME_H_
2 #define UGDK_MATH_FRAME_H_
32 Frame() : left_(0), top_(0), right_(0), bottom_(0) { }
40 Frame(
double _left,
double _top,
double _right,
double _bottom) :
41 left_(_left), top_(_top), right_(_right), bottom_(_bottom) { }
46 double width()
const {
return right_ - left_; }
48 double height()
const {
return bottom_ - top_; }
56 void set_top(
double _top) { top_ = _top; }
60 double left()
const {
return left_; }
61 double top()
const {
return top_; }
62 double right()
const {
return right_; }
63 double bottom()
const {
return bottom_; }
72 double left_, top_, right_, bottom_;
78 #endif // UGDK_MATH_FRAME_H_
Represents a frame on the screen or an image.
Definition: frame.h:28
~Frame()
Definition: frame.h:42
double right() const
Definition: frame.h:62
void set_left(double _left)
Definition: frame.h:55
double bottom() const
Definition: frame.h:63
Definition: animation.h:11
double width() const
Returns the width of the frame.
Definition: frame.h:46
Frame(double _left, double _top, double _right, double _bottom)
Creates a frame with the given coordinates.
Definition: frame.h:40
double top() const
Definition: frame.h:61
void set_right(double _right)
Definition: frame.h:57
Frame()
Creates an empty frame at (0, 0).
Definition: frame.h:32
void set_top(double _top)
Definition: frame.h:56
double left() const
Definition: frame.h:60
bool Collides(const math::Frame &frame) const
Returns whether this frame and the other frame are colliding.
double height() const
Returns the height of the frame.
Definition: frame.h:48
void set_bottom(double _bottom)
Definition: frame.h:58