getSpriteRotation()
Purpose
Get the rotation angle of a sprite
Description
Get the current rotation angle of a sprite in the default angle units
Syntax
angle = getSpriteRotation( sprite )
angle = sprite.rotation
Arguments
sprite handle of the created sprite
rotation angle in the default units
Example
image = loadImage( "Untied Games/Enemy small top C", false )
ship = createSprite()
setSpriteImage( ship, image )
lastpos = { gWidth() / 2, gHeight() / 2 }
setSpriteLocation( ship, lastpos )
setSpriteScale( ship, { 10, 10 } )
setSpriteRotationSpeed( ship, 60 )
loop
clear()
angle = getSpriteRotation( ship )
if angle > 360 then
setSpriteRotationSpeed( ship, -60 )
endIf
if angle < 0 then
setSpriteRotationSpeed( ship, 60 )
endIf
updateSprites()
drawSprites()
update()
repeat
Associated Commands
getSpriteRotationSpeed(), setSpriteRotation(), setSpriteRotationSpeed()