DrawAllCameras
DrawAllCameras
 
Parameters: NONE
Returns: NONE
 

      DrawAllCameras will render all the currently created cameras to their attached surfaces.

      The cameras will be drawn in order based upon their priority settings. Cameras with a low priority will be drawn before cameras with a

      For more information about cameras pease read the Camera tutorial in the About Section.




FACTS:


      * When a camera is drawn it will automatically Sort and draw the Scene buffer items, so that items with the lowest Z depth will be drawn in front of items with a higher depth.

      * Cameras by default have CameraCLS backdrop enabled.


 
Example Source: Download This Example
; Create Camera 1, Which will camera will Default to the current
; surfaces size
  CreateCamera 1
  
; resize cameras View port to the left side for the screen
  CameraViewPort 1,5,5,(GetScreenWidth()/2)-5,GetScreenHeight()-5
  
  
  
; Now resize their uotput ar
  CreateCamera 2
; resize cameras View port to the left side for the screen
  CameraViewPort 2,(GetScreenWidth()/2)+5,5,GetScreenWidth(),GetScreenHeight()-5
  
  
; Tell Playbasic to now capture the following gfx commands to the scene
; buffer
  CaptureToScene
  
; Render a bunch of randomly positioned DOTS/CIRCLES and BOXES to the SCENE BUFFER
  WorldWidth=1500
  WorldHeight=1500
  
  For lp =0 To 500
     x=Rnd(WorldWidth)
     y=Rnd(Worldheight)
     w=Rnd(50)
     Select Rnd(2)
         Case 0
             DotC x,y,RndRGB()
         Case 1
             CircleC x,y,w,Rnd(1),RndRGB()
         Case 2
             BoxC x,y,x+w,y+w,Rnd(1),RndRGB()
             
     EndSelect
  Next
  
; Tell PlayBasic to now draw gfx when a gfx command is executed
  DrawGFXImmediate
  
; Start the programs mani loop
  Do
     Cls RGB(200,160,200)
     
   ; This code will move camera 2
     PositionCameraX 2,Mod((GetCameraX(2)+1),1000)
     
     
   ; This code will let the user control CAMERA #1 using the ARROW keys
     Speed=5
     If LeftKey() Then MoveCamera 1,-speed,0
     If RightKey() Then MoveCamera 1,speed,0
     If UpKey() Then MoveCamera 1,0,-speed
     If DownKey() Then MoveCamera 1,0,speed
     
   ; draw what the camera can currently see
     DrawAllCameras
     
   ; Refresh the Screen
     Sync
   ;Loop back to the DO statement above
  Loop
  
  
  
 
Related Info: CameraBasics | CaptureToScene | CreateCamera | DrawCamera | NewCamera :
 


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