News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Setting the Cameras

Started by Kman1011, November 19, 2006, 09:06:05 PM

Previous topic - Next topic

Kman1011

I just had a question about how to get text,graphics, ect.. to another camera. What function makes a camera 'Current' so that that camera can be used. ???

I've written a demo that uses a main camera to display a map but i want to write the status on another camera. How would I do that? Here's part of the program

;CREATE A CAMERA
CreateCamera 1
DrawCamera 1
LimitCamera 1,True
LimitCameraBounds 1,0,0,128*97,128*97
CameraViewPort 1,0,0,800,768
;Create stat camera


CapturetoScene
;Draw the map
DrawMap 1,1,0,0
;Draw GFX Immeadiatetly
DrawGFXImmediate

CreateCamera 2
CameraViewport 2,801,0,1024,768
CameraPriority 1,1
do

DrawAllCameras 
   Speed=2
   if upkey() then MoveCamera 1,0,-Speed
if Downkey() then MoveCamera 1,0,Speed
if Rightkey() then MoveCamera 1,Speed,0
if Leftkey() then MoveCamera 1,-Speed,0


print "Camera X Position:"+Str$(GetCameraX(1))
print "Camera Y Position:"+Str$(GetCameraY(1))

   
sync
loop


I've checked the docs but nothing seems to switch camera views
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

kevin

  That's because you don't need to.    A camera is really a 'sorting and clipping' engine.   All cameras process from the scene buffer (a que of captured draw events)  to their output view port upon drawing.   So camera don't have their own unique scene buffer as your expecting I think.  They share the global scene buffer. 

  Now as items are capture  into the global scene (you send a draw request)  you can tag their visibility to any or camera by using the CaptureVIS command. Which sets the visibility flags of this captured item.

  There's an example   projects/Examples/Camera/CaptureVIs.

Kman1011

Yeah I think I know what you mean. You can have two cameras but in the same world

Right?
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA