MoveCamera
MoveCamera CameraIndex, XDist#, YDist#
 
Parameters:

    CameraIndex = The Index Identifier of the Camera that you wish to read from
    XDist# = The distance you wish to move this camera along the X axis
    YDist# = The distance you wish to move this camera along the Y axis
Returns: NONE
 

      MoveCamera changes the position of a camera along both the X and Y axis.



FACTS:


      * The cameras position relates the top left hand coordinate of the cameras viewport. So position 0,0 of the viewport equates to the cameras X/Y position in world space.

      * Camera positions are in World Space not Screen Space.




Mini Tutorial:


      Create a camera, position it and then read back and display this position.

  
  
; CReate a Camera
  CreateCamera 1
  
; Position This Camera to the world space coord of 3000,4000
  PositionCamera 1,3000,4000
  
; Read this cameras X & Y Positions
  Print "Cameras X pos:"+Str$(GetCameraX(1))
  Print "Cameras Y pos:"+Str$(GetCameraY(1))
  
; Shift the Camera along X axis by 10, and the y axis by 20
  MoveCamera 1,10,20
  
; Read this cameras X & Y Positions
  Print "Cameras X pos:"+Str$(GetCameraX(1))
  Print "Cameras Y pos:"+Str$(GetCameraY(1))
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  Cameras X pos:3000.0
  Cameras Y pos:4000.0
  Cameras X pos:3010.0
  Cameras Y pos:4020.0
  




 
Related Info: GetCameraX | GetCameraY | LimitCamera | LimitCameraBounds | PositionCamera | PositionCameraX | PositionCameraY :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com