CreateCamera
CreateCamera CameraIndex
 
Parameters:

    CameraIndex = The Index of the Camera that you wish to create.
Returns: NONE
 

      CreateCamera will initialize a user camera. When a camera is created it attaches to the current drawing surface. Normally this will be the screen, but they can be attached to images also. Moreover, the newly created cameras viewport will assume the size of the surface (image or screen) that it was attached to.

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

      Cameras are used in conjunction with the scene and world buffer controls, we strongly recommend reading CameraBasics tutorial in the About section.




FACTS:


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

      * Cameras by default have CLS backdrop enabled.

      * See NewCamera for dynamic version.




Mini Tutorial:


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

  
  
  
; Create camera 1 which will be attached to the current drawing surface,
; which by default will be the screen.
  
  CreateCamera 1
  
; Display ALL the info about this camera.
  ShowCameraInfo(1)
  
; 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$(GetCameraY(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 | DrawAllCameras | DrawCamera | GetCameraStatus | GetFreeCamera | NewCamera :
 


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