UnderwareDESIGN

PlayBASIC => Resources => Source Codes => Topic started by: kevin on July 07, 2004, 12:53:07 PM

Title: Basic Cameras
Post by: kevin on July 07, 2004, 12:53:07 PM
[pbcode]
;---------------------------------------------------------------------
; Simple Camera
;---------------------------------------------------------------------
; create the camera. By default it will sie it's self to the size of the current; screen

CreateCamera 1

  Do
 
     Cls 0
     
   ; TEll PB to redirect all(well most immediate drawing ops) to the Scene buffer
     
     CaptureToScene
   ; Clear the Scene buffer of any previous draw events
     ClsScene
 
   ; tell PB what depth(priority) the next things your going to be
   ; drawing will be..  Depths, make things appear at the back, lower
   ; depths will make them be draw to the front..

     CaptureDepth  10
     Text 100,100,"This text would normally be hidden by"
     Text 100,120," the box being drawn after it... "
 
 
    CaptureDepth  100
    BoxC 0,0,600,300,true,RGB(40,70,80)
 
   
   ; DRaw a circle in between the Text and the Box
    CaptureDepth  50
    CircleC 300,200,200,1,RGB(80,70,00)
   
     
     ; render whats in view of the camera to the screen... After this, drawing is back to normal Immediate mode
     DrawCamera 1
    
     Print "HELLO, i'm drawn in immediate mode"
   
     sync 
  loop


[/pbcode]