tbx  0.7.3
Public Member Functions | List of all members
tbx::ScaleFactors Class Reference

Class for sprite ScaleFactors. More...

#include <scalefactors.h>

Public Member Functions

 ScaleFactors ()
 Constructor that creates the unit scale factors. More...
 
 ScaleFactors (int xm, int ym, int xd, int yd)
 Constructor allowing the multipliers and dividers to be specified. More...
 
 ScaleFactors (int mult, int div=1)
 Constructor for common multiplier/divider in x and y directions. More...
 
bool is_unit () const
 Returns true if scale factors do not change a value.
 
int xmult () const
 Return the x direction multiplier.
 
ScaleFactorsxmult (int x)
 Set the x direction multiplier. More...
 
int ymult () const
 Return the y direction multiplier.
 
ScaleFactorsymult (int y)
 Set the y direction multiplier. More...
 
int xdiv () const
 Return the x direction divider.
 
ScaleFactorsxdiv (int x)
 Set the x direction divider. More...
 
int ydiv () const
 Return the y direction divider.
 
ScaleFactorsydiv (int y)
 Set the y direction divider. More...
 
int * as_array ()
 Return 4 integer array of scale factors.
 
const int * as_array () const
 Return 4 integer array of scale factors.
 

Detailed Description

Class for sprite ScaleFactors.

ScaleFactors are used to scale a coordinate using integer values

The scaling is xmult()/xdiv() for the x direction and ymult()/ydiv() for the y direction

Constructor & Destructor Documentation

tbx::ScaleFactors::ScaleFactors ( )
inline

Constructor that creates the unit scale factors.

i.e. no scaling

tbx::ScaleFactors::ScaleFactors ( int  xm,
int  ym,
int  xd,
int  yd 
)
inline

Constructor allowing the multipliers and dividers to be specified.

Parameters
xmx direction multiplier
ymy direction multiplier
xdx direction divider
ydy direction divider
tbx::ScaleFactors::ScaleFactors ( int  mult,
int  div = 1 
)
inline

Constructor for common multiplier/divider in x and y directions.

Parameters
multx and y direction multiplier
divx and y divider (defaults to 1)

Member Function Documentation

ScaleFactors& tbx::ScaleFactors::xdiv ( int  x)
inline

Set the x direction divider.

Parameters
xnew x direction divider
Returns
*this
ScaleFactors& tbx::ScaleFactors::xmult ( int  x)
inline

Set the x direction multiplier.

Parameters
xnew x direction multiplier
Returns
*this
ScaleFactors& tbx::ScaleFactors::ydiv ( int  y)
inline

Set the y direction divider.

Parameters
ynew y direction divider
Returns
*this
ScaleFactors& tbx::ScaleFactors::ymult ( int  y)
inline

Set the y direction multiplier.

Parameters
ynew y direction multiplier
Returns
*this

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