Functions | |
| void | ulResetScreenView () |
| void | ulMoveScreenView (int posX, int posY) |
| void | ulScaleScreenView (int scaleX, int scaleY) |
| void | ulRotateScreenView (int angle) |
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.
| 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.
| 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. |
| void ulScaleScreenView | ( | int | scaleX, | |
| int | scaleY | |||
| ) |
Scales the screen view.
| scaleX | Horizontal scaling factor. 4096 (1 << 12) means 1. 8192 means 2 and 2048 means 0.5 for example. | |
| scaleY | Vertical scaling factor. |
Note 2: Scaling with a negative factor flips the screen. This can be useful...
| void ulRotateScreenView | ( | int | angle | ) |
Rotates the screen view.
| 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. |
ulMoveScreenView(UL_SCREEN_WIDTH / 2, UL_SCREEN_HEIGHT / 2); ulRotateScreenView(angle); ulMoveScreenView(-UL_SCREEN_WIDTH / 2, -UL_SCREEN_HEIGHT / 2);
1.5.2