Clockwise rotation in degrees of all the sprites in the group.
A positive value will rotate clockwise, a negative value will rotate counterclockwise. The rotation usually will be a number between -360 and 360.
The default rotation is 0, which is in the positive x direction.
var group = createGroup();
group.add(createSprite(100, 200));
group.add(createSprite(300, 200));
function draw() {
background("white");
drawSprites();
if (mouseDown("leftButton")){
group.setRotationEach(65);
}
else {
group.setRotationEach(25);
}
}
group.setRotationEach(angle)
| Name | Type | Required? | Description |
|---|---|---|---|
| angle | Number | The rotation angle. |
No return value. Changes output in the display after drawSprites() is called.
drawSprites() is called.Found a bug in the documentation? Let us know at documentation@code.org