Screen view
[Drawing]


Functions

void ulResetScreenView ()
void ulMoveScreenView (int posX, int posY)
void ulScaleScreenView (int scaleX, int scaleY)
void ulRotateScreenView (int angle)

Detailed Description

Contains functions to move, rotate and scale the screen as a whole. This will affect the objects that you will draw after having called these commands, the objects drawn before will stay as they were.

Something interesting is that all these function can be combined to fine tune your final screen transformation. For example you can move the screen and then rotate it, enabling you to control its rotation center.


Function Documentation

void ulResetScreenView (  ) 

Resets the screen projection to its initial state. The objects drawn from here will not be transformed anymore.

void ulMoveScreenView ( int  posX,
int  posY 
)

Moves the screen as a whole.

Parameters:
posX Horizontale move. A positive values means moving rightwards while a negative value moves leftwards.
posY Vertical move. A positive value means moving downwards while a negative value moves upwards.
Note: The values for these parameters are defined in pixels.

void ulScaleScreenView ( int  scaleX,
int  scaleY 
)

Scales the screen view.

Parameters:
scaleX Horizontal scaling factor. 4096 (1 << 12) means 1. 8192 means 2 and 2048 means 0.5 for example.
scaleY Vertical scaling factor.
Note: The values for these parameters are defined in fixed point. There are 20 bits for the integer part and 12 bits for the decimal part. If you want to convert an integer number to a fixed factor you can do the following: inttof32(number). If you want to convert a float to a fixed number, you can do floattof32(number).

Note 2: Scaling with a negative factor flips the screen. This can be useful...

void ulRotateScreenView ( int  angle  ) 

Rotates the screen view.

Parameters:
angle Angle of rotation. It's not in degrees but in the same scale that ulSin, ulCos, etc. between 0 and 2 * UL_PI. The rotation is done clockwise.
Don't forget that you can mix up these routines to fine tune your transformation. For example, by default a rotation is done around the top-left point of the screen. If you want to center your rotation, you can just move your screen prior to rotate it and move it to its initial position afterwards.


Generated on Tue Dec 25 17:51:36 2007 by  doxygen 1.5.2