A Sprite is a 2D image that can be animated or transformed by changing its properties, including its rotation, position, scale, color, and so on. After creating a sprite you can obtain access to the variety of properties it has, which can be manipulated.
You can change the sprite's rotation to positive or negative degrees.
sprite->setRotation(30.0f);
You can get the rotation value using getRotation
method.
float rotation = sprite->getRotation();
The positive value rotates it clockwise, and the negative value rotates it counter clockwise. The default value is zero. The preceding code rotates the sprite 30 degrees clockwise, as shown in the following screenshot: