NewCamera
CameraIndex = NewCamera()
 
Parameters: NONE
Returns:

    CameraIndex = The Index of the newly created Camera
 

      NewCamera will initialize a user camera. When a camera is created it will attach it self to the current drawing surface (See GetSurface()). Normally this will be the screen, but they can be attached to images also. Moreover the camera will assume the size of the surface (image or screen) that it's attached to.

      Conceptually, Cameras are used to show a part of your game world from a particular view point. This allows the programmer to create worlds much larger than then screen, but still be able to easily display it.

      Cameras are used in conjunction with the scene and world buffer controls. I strongly advise reading CameraBasics tutorial in the About Section.




FACTS:


      * By default when a camera is created, it attaches it'self to current drawing surface. From here it will inherit that surfaces size.

      * Cameras by default have CameraCLS backdrop enabled.




Mini Tutorial:


      This example will create a camera than dispaly its properties for you.

  
; Create a new camera. This camera will be attached to the
; current drawing surface, which by default will be the
; screen.
  ThisCamera=NewCamera()
  
; Display ALL the info about this camera.
  ShowCameraInfo(ThisCamera)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  End
  
  
  
Function ShowCameraInfo(ThisCamera)
  
  Print "Camera Info"
  Print ""
  Print " Status:"+Str$(GetCameraStatus(ThisCamera))
  Print " Attached to Surface:"+Str$(GetCameraSurface(ThisCamera))
  Print " Visible:"+Str$(GetCameraVisible(ThisCamera))
  Print " Priority:"+Str$(GetCameraPriority(ThisCamera))
  Print ""
  Print " Auto Cls Status:"+Str$(GetCameraCls(ThisCamera))
  Print " Cls Colour:"+Str$(GetCameraClsColour(ThisCamera))
  Print ""
  Print " Xpos:"+Str$(GetCameraX(ThisCamera))
  Print " Ypos:"+Str$(GetCameraX(ThisCamera))
  Print " Width:"+Str$(GetCameraWidth(ThisCamera))
  Print " Height:"+Str$(GetCameraHeight(ThisCamera))
  Print ""
  Print " ViewPort X1:"+Str$(GetCameraViewPortX1(ThisCamera))
  Print " ViewPort Y1:"+Str$(GetCameraViewPortY1(ThisCamera))
  Print " ViewPort X2:"+Str$(GetCameraViewPortX2(ThisCamera))
  Print " ViewPort Y2:"+Str$(GetCameraViewPortY2(ThisCamera))
  
  Print ""
  Print " Limit Status:"+Str$(GetCameraLimit(ThisCamera))
  Print " Limit X1:"+Str$(GetCameraLimitX1(ThisCamera))
  Print " Limit Y1:"+Str$(GetCameraLimitY1(ThisCamera))
  Print " Limit X2:"+Str$(GetCameraLimitX2(ThisCamera))
  Print " Limit Y2:"+Str$(GetCameraLimitY2(ThisCamera))
EndFunction
  




This example would output with the program was running with the default 640*480 screen.

  
  Camera Info
  
  Status:1
  Attached To Surface: 0
  Visible:1
  Priority:0
  
  Auto Cls Status:1
  Cls Colour:0
  
  Xpos:0
  Ypos:0
  Width:640
  Height:480
  
  ViewPort X1:0
  ViewPort Y1:0
  ViewPort X2:640
  ViewPort Y2:480
  
  Limit Status:0
  Limit X1:0
  Limit Y1:0
  Limit X2:0
  Limit Y2:0
  

 
Related Info: CameraBasics | CaptureToScene | DeleteCamera | DrawCamera | GetCameraStatus | GetFreeCamera :
 


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