Class for sprite ScaleFactors.
More...
#include <scalefactors.h>
|
| 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.
|
|
ScaleFactors & | xmult (int x) |
| Set the x direction multiplier. More...
|
|
int | ymult () const |
| Return the y direction multiplier.
|
|
ScaleFactors & | ymult (int y) |
| Set the y direction multiplier. More...
|
|
int | xdiv () const |
| Return the x direction divider.
|
|
ScaleFactors & | xdiv (int x) |
| Set the x direction divider. More...
|
|
int | ydiv () const |
| Return the y direction divider.
|
|
ScaleFactors & | ydiv (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.
|
|
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
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
-
xm | x direction multiplier |
ym | y direction multiplier |
xd | x direction divider |
yd | y direction divider |
tbx::ScaleFactors::ScaleFactors |
( |
int |
mult, |
|
|
int |
div = 1 |
|
) |
| |
|
inline |
Constructor for common multiplier/divider in x and y directions.
- Parameters
-
mult | x and y direction multiplier |
div | x and y divider (defaults to 1) |
Set the x direction divider.
- Parameters
-
- Returns
- *this
Set the x direction multiplier.
- Parameters
-
x | new x direction multiplier |
- Returns
- *this
Set the y direction divider.
- Parameters
-
- Returns
- *this
Set the y direction multiplier.
- Parameters
-
y | new y direction multiplier |
- Returns
- *this
The documentation for this class was generated from the following file: