rotate

All rotations are clockwise, and all angles are in radians.

rotate( angle, isCentred = false )

Rotates the screen by the angle given. If 'isCentred' is false, then this is performed around the origin. This means it will rotate around the pixel at 0x0, which is at the top left corner of the screen. If 'isCentred' is true, then it will rotate around the centre of the screen.

rotate( angle, x, y )

This rotates the screen around the x and y location given.

/* 
 * Draws a set of circles, around the middle of the screen.
 * The position is achieved using rotations.
 */

numCircles = 15

onEachFrame() do
    fill( :black )
    
    setColor( :red )
    numCircles.times() do |i|
        angle = 360 / numCircles
        
        rotate( angle.toRadians(), true )
        
        fillCircle( getScreenWidth()/2 + 100, getScreenHeight()/2,
                18, true )
    end
end

See also

scale - translate