Gosu::RotFlip Class Reference

Light-weight class that encodes a rotation by 0, 90, 180, or 270 degrees as well as optional horizontal and/or vertical flips. More...

List of all members.

Public Member Functions

 RotFlip (RotFlipName name=rfDefault)
RotFlipName name () const
void flipX ()
void flipY ()
void rotate90 ()
void rotate180 ()
void rotate270 ()
bool flipped () const
bool rotated () const
unsigned mapCorner (unsigned n) const
unsigned realCorner (unsigned n) const


Detailed Description

Light-weight class that encodes a rotation by 0, 90, 180, or 270 degrees as well as optional horizontal and/or vertical flips.

In short, this convieniently encodes the eight ways in which a aligned rectangle can be linearly transformed to result in an aligned rectangle again. Especially useful for games with tile-based maps.

Definition at line 43 of file RotFlip.hpp.


Constructor & Destructor Documentation

Gosu::RotFlip::RotFlip ( RotFlipName  name = rfDefault  ) 

Definition at line 55 of file RotFlip.hpp.


Member Function Documentation

bool Gosu::RotFlip::flipped (  )  const

Definition at line 90 of file RotFlip.hpp.

void Gosu::RotFlip::flipX (  ) 

Definition at line 65 of file RotFlip.hpp.

void Gosu::RotFlip::flipY (  ) 

Definition at line 70 of file RotFlip.hpp.

unsigned Gosu::RotFlip::mapCorner ( unsigned  n  )  const

Definition at line 100 of file RotFlip.hpp.

RotFlipName Gosu::RotFlip::name (  )  const

Definition at line 60 of file RotFlip.hpp.

unsigned Gosu::RotFlip::realCorner ( unsigned  n  )  const

Definition at line 105 of file RotFlip.hpp.

void Gosu::RotFlip::rotate180 (  ) 

Definition at line 80 of file RotFlip.hpp.

void Gosu::RotFlip::rotate270 (  ) 

Definition at line 85 of file RotFlip.hpp.

void Gosu::RotFlip::rotate90 (  ) 

Definition at line 75 of file RotFlip.hpp.

bool Gosu::RotFlip::rotated (  )  const

Definition at line 95 of file RotFlip.hpp.


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