setSpriteCameraRotation()
Purpose
Rotate the sprite camera
Description
Set the sprite camera rotation angle
Syntax
setSpriteCameraRotation( angle )
Arguments
angle camera rotation angle in the default units
Example
image = loadImage( "Untied Games/Enemy A", false )
enemy = []
for i = 0 to 4 loop
enemy[i] = createSprite()
setSpriteImage( enemy[i], image )
setSpriteAnimation( enemy[i], 0, 4, 20 )
setSpriteLocation(enemy[i], { ( i % 2 ) * 400 + 400, int( i / 2 ) * 300 + 200 } )
setSpriteScale( enemy[i], { 4, 4 } )
repeat
camera = getSpriteCamera()
rotation = getSpriteCameraRotation()
loop
clear()
c = controls( 0 )
printAt( 0, 0, "Camera posotion: x = ", camera.x, " y = ", camera.y, " z = ", camera.z, " rotation: ", rotation )
printAt( 0, 1, "Use left joypad to pan, right joypad to zoom/rotate" )
if c.up then
camera.y -= 5
endIf
if c.down then
camera.y += 5
endIf
if c.left then
camera.x -= 5
endIf
if c.right then
camera.x += 5
endIf
if c.x then
camera.z += 0.05
endIf
if c.b then
camera.z -= 0.05
endIf
if c.y then
rotation -= 0.5
endIf
if c.a then
rotation += 0.5
endIf
setSpriteCamera( camera.x, camera.y, camera.z )
setSpriteCameraRotation( rotation )
updateSprites()
drawSprites()
update()
repeat
Associated Commands
centreSpriteCamera(), getSpriteCamera(), getSpriteCameraRotation(), setSpriteCamera()