In the code you licked it doesn’t use to cameras. I think you want something like this:
public class splitedScreen extends World //actually extends the world you want
{
public var camera1:Point;
public var camera2:Point;
private var _view1:BitmapData;
private var _view2:BitmapData;
private var _rect1:Rectangle;
private var _rect2:Rectangle;
private var _copyOffset:Point;
public function splitedScreen()
{
super();
//we create a second camera (we can't use camera)
camera1 = new Point;
camera2 = new Point;
//we set where will go the two part of the screens (save that in two rectangles)
//Changing the values here will modify the size of the splited screens. This is vertical but can be in any rectangular form.
_rect1 = new Rectangle(0, 0, FP.width, FP.height/2);
_rect2 = new Rectangle(0, FP.height/2, FP.width, FP.height/2);
//we create the bitmapDatas with its size
_view1 = new BitmapData(_rect1.width, _rect1.height);
_view2 = new BitmapData(_rect2.width, _rect2.height);
//You may not want to get the buffer in the 0,0 so you can take an offset
//This offset is equal in both views but you can set twoo different views.
_copyOffset = new Point;
}
override public function render():void
{
//here goes the magic part. FP renders everything in a BitmapData. So the idea is to render, copy that buffer, change the camera, render again, save that buffer too and then getting both of them.
camera = camera1;
super.render();
_view1.copyPixels(FP.buffer, _rect1, _rect1.topLeft);
FP.screen.refresh();
camera = camera2;
super.render();
_view2.copyPixels(FP.buffer, _rect2, _rect2.topLeft);
FP.screen.refresh();
//finally we render both screens. If overlaps the _view1 have priority.
FP.buffer.copyPixels(_view2, _rect2, _rect2.topLeft);
FP.buffer.copyPixels(_view1, _rect1, _rect1.topLeft);
}
}