Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

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()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.