setSpriteRotation()
Purpose
Rotate a sprite
Description
Set the rotation angle of a sprite
Syntax
setSpriteRotation( sprite, angle )
sprite.rotation = angle
Arguments
sprite handle of the created sprite
rotation angle in 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, { 8, 8 } )
for angle = 0 to 360 loop
clear()
setSpriteRotation( ship, angle )
drawSprites()
update()
repeat
Associated Commands
getSpriteRotation(), getSpriteRotationSpeed(), setSpriteRotationSpeed()