centreSpriteCamera()
Purpose
Centre the sprite camera
Description
Used the centre the sprite camera around a supplied position
Syntax
centreSpriteCamera( pos )
centreSpriteCamera( xpos, ypos )
Arguments
pos vector position of the centre point { x, y }
xpos float position of the centre point on the x axis
ypos float position of the centre point on the y axis
Example
image = loadImage( "Untied Games/Shroom Hopper A" )
spr = createSprite()
setSpriteImage( spr, img )
setSpriteAnimation( spr, 42, 49, 10 )
setSpriteCamera( 0, 0, 8 )
centrePoint = { 0, 0 }
loop
clear()
updateSprites()
j = controls( 0 )
centrePoint += { -j.lx, j.ly }
// centre sprite camera around { 0, 0 }
// use left control stick to adjust centre point
centreSpriteCamera( centrePoint )
drawSprites()
update()
repeat
Associated Commands
setSpriteCamera(), getSpriteCamera(), getSpriteCameraRotation(), setSpriteCameraRotation()