UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::math::Frame Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

ugdk::math::Frame::Frame ( )
inline

Creates an empty frame at (0, 0).

ugdk::math::Frame::Frame ( double  _left,
double  _top,
double  _right,
double  _bottom 
)
inline

Creates a frame with the given coordinates.

Parameters
leftThe left margin
topThe upper margin
rightThe right margin
bottomThe lower margin
ugdk::math::Frame::~Frame ( )
inline

Member Function Documentation

double ugdk::math::Frame::bottom ( ) const
inline
bool ugdk::math::Frame::Collides ( const math::Frame frame) const

Returns whether this frame and the other frame are colliding.

double ugdk::math::Frame::height ( ) const
inline

Returns the height of the frame.

double ugdk::math::Frame::left ( ) const
inline
double ugdk::math::Frame::right ( ) const
inline
void ugdk::math::Frame::set_bottom ( double  _bottom)
inline
void ugdk::math::Frame::set_left ( double  _left)
inline
void ugdk::math::Frame::set_right ( double  _right)
inline
void ugdk::math::Frame::set_top ( double  _top)
inline
double ugdk::math::Frame::top ( ) const
inline
double ugdk::math::Frame::width ( ) const
inline

Returns the width of the frame.


The documentation for this class was generated from the following file: