CameraCls
CameraCls CameraIndex, ClsFlag
 
Parameters:

    CameraIndex = The Index of the Camera that you wish to change
    ClsFlag = On / off flag to toggle the cameras auto cls
Returns: NONE
 

      CameraCls will set the CLS state of a camera. When a cameras CLS state is set to TRUE(1), It will clear the cameras view port (it's disaply/screen area) to the cameras current CLS Colour, before drawing whats in view. So the camera can have it's own default backdrop colour.

      You can set the CLS colour using the CameraClsColour command.



FACTS:


      * When a camera has auto cls enabled. The Cls will occur before anything else is drawn. So the Cls colour can be thought of as the cameras backdrop colour.

      * Auto CLS will only clear the cameras viewport. Nothing outside this area will be cleared.

      * If your camera is attached to the screen, then it can often be faster to turn camera cls off and do a normal CLS. This is because the CLS operation is asynchronously , meaning that computers graphics chip can perform the clear operation, while the main CPU is running your program code. So it's doing two things at once.





Mini Tutorial:


      This example creates a camera, adjusts it size to a custom view port, activates the Auto CLS an sets it's CLS colour to a bright green colour, before drawing a circle to the scene buffer and finally displaying the camera.



  
  
; create a camera 1.  Which will attach itself to
; the screen
  CreateCamera 1
  
; Set the Cameras View port area to 100x,100x to 200,200
  CameraViewPort 1,100,100,200,200
  
; Activate the camera Auto CLS to screen the cameras viewport
; before it starts drawing
  CameraCls 1,on
  
; Set the Cameras Auto CLS colour to Bright green colour
  CameraClsColour 1,RGB(0,255,0)
  
; Direct All gfx to the Scene buffer so the camera
; has something to view.
  CaptureToScene
  
; draw a white circle the Scene
  Circle 50,50,40,1
  
; Draw the camera and whatever it can see
  DrawCamera 1
  
; Show the user the screen.
  Sync
  
; wait for a key press, before ending
  WaitKey
  



This example would output.

  
  no output
  


 
Related Info: CameraClsColour | Cls | DrawAllCameras | DrawCamera | GetCameraCls | GetCameraClsColour :
 


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