Game Development Reference
Rotating and scaling a view
There are two more transformations that we can perform on any view instance—rotation
and scale. Both of them have limited uses, but comes in handy when we want specific fea-
tures from our camera.
To rotate a view, we call View::setRotation() or View::rotate() , depending
on the type of rotation we want to perform. The View::setRotation() method as-
signs an absolute value to the rotation of View , whereas View::rotate() adds the ro-
tation value passed. The latter is typically used when we want to gradually increase the ro-
tation over a period of time.
The rotation itself works as one might expect—it rotates the scene (every object) around
the center of the view. Here is a setup for a test we are going to perform: