this is a function that splits the screen into 2 camera views. It also sets the aspect so it looks right.
sync on
sync rate 0
cls
hide mouse
autocam off
make matrix 1,100,100,20,20
make camera 1
global screen_split=0
split_screen(0,1,screen_split)
color backdrop 0,0
color backdrop 1,0
dim player(1) as player_type
type player_type
object
endtype
for n=0 to 1
player(n).object=n+1
obj=player(n).object
make object box obj,1,1,1
position object obj,rnd(100),0.5,rnd(100)
yrotate object obj,rnd(359)
next n
do
ink rgb(0,255,0),0
if screen_split=1
box 0,screen height()/2-1,screen width(),screen height()/2+1
else
box screen width()/2-1,0,screen width()/2+1,screen height()
endif
for n=0 to 1
obj=player(N).object
set camera to follow n,object position x(obj),object position y(obj),object position z(obj),object angle y(obj),8,6,10,0
point camera n,object position x(obj),object position y(obj),object position z(obj)
next n
move object 2,(upkey()-downkey())*0.1
yrotate object 2,object angle y(2)+rightkey()-leftkey()
move object 1,(keystate(17)-keystate(31))*0.1
yrotate object 1,object angle y(1)+keystate(32)-keystate(30)
sync
loop
function split_screen(c1,c2,flag)
`if flag=0 then vertical split
`if flag=1 then horizontal split
if flag=0
set camera view c1,0,0,screen width()/2,screen height()
a#=(screen width()/2.0)/screen height()
set camera aspect c1,a#
set camera view c2,screen width()/2,0,screen width(),screen height()
set camera aspect c2,a#
endif
if flag=1
set camera view c1,0,0,screen width(),screen height()/2
a#=screen width()/(screen height()/2.0)
set camera aspect c1,a#
set camera view c2,0,screen height()/2,screen width(),screen height()
set camera aspect c2,a#
endif
endfunction
-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.