sfRect< T > Class Template Reference

#include <Rect.hpp>

List of all members.

Public Member Functions

 sfRect ()
 sfRect (T LeftCoord, T TopCoord, T RightCoord, T BottomCoord)
GetWidth () const
GetHeight () const
bool Intersect (const sfRect< T > &Rect, sfRect< T > *OverlappingRect=NULL) const

Public Attributes

Left
 Left coordinate of the rectangle.
Top
 Top coordinate of the rectangle.
Right
 Right coordinate of the rectangle.
Bottom
 Bottom coordinate of the rectangle.


Detailed Description

template<typename T>
class sfRect< T >

sfRect is an utility class for manipulating rectangles. Template parameter defines type of coordinates (integer float, ...)

Definition at line 39 of file Rect.hpp.


Constructor & Destructor Documentation

template<typename T>
sfRect< T >::sfRect (  )  [inline]

Default constructor

Definition at line 30 of file Rect.inl.

Referenced by sfRect< T >::Intersect().

template<typename T>
sfRect< T >::sfRect ( LeftCoord,
TopCoord,
RightCoord,
BottomCoord 
) [inline]

Construct the color from its coordinates

Parameters:
LeftCoord : Left coordinate of the rectangle
TopCoord : Top coordinate of the rectangle
RightCoord : Right coordinate of the rectangle
BottomCoord : Bottom coordinate of the rectangle

Definition at line 44 of file Rect.inl.


Member Function Documentation

template<typename T>
T sfRect< T >::GetWidth (  )  const [inline]

Get the width of the rectangle

Returns:
Width of rectangle

Definition at line 58 of file Rect.inl.

References sfRect< T >::Left, and sfRect< T >::Right.

Referenced by sfAnimatedSprite::CreateAnimation(), sfSprite::GetWidth(), and sfSprite::Render().

template<typename T>
T sfRect< T >::GetHeight (  )  const [inline]

Get the height of the rectangle

Returns:
Height of rectangle

Definition at line 68 of file Rect.inl.

References sfRect< T >::Bottom, and sfRect< T >::Top.

Referenced by sfAnimatedSprite::CreateAnimation(), sfSprite::GetHeight(), and sfSprite::Render().

template<typename T>
bool sfRect< T >::Intersect ( const sfRect< T > &  Rect,
sfRect< T > *  OverlappingRect = NULL 
) const [inline]

Check intersection between two rectangles

Parameters:
Rect : Rectangle to test
OverlappingRect : Rectangle to be filled with overlapping rect (NULL by default)
Returns:
True if rectangles overlap

Definition at line 78 of file Rect.inl.

References sfRect< T >::Bottom, sfRect< T >::Left, sfRect< T >::Right, sfRect< T >::sfRect(), and sfRect< T >::Top.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2