Google translator could be wrong laugh but from what I've understood , you need something like this:

ship_max_x = camera.x + 300;
ship_min_x = camera.x - 300;
if(ship.x > ship_max_x) { ship.x = ship_max_x; }
if(ship.x < ship_min_x) { ship.x = ship_min_x; }

Thats assuming camera and ship move on +X axis(forward)
Tweak "300" to get the maximum X your ship can move to the right.

*EDIT* Ship_max and min_x have to be calculated every frame, this way, when you move the camera, the max and min change too, to keep your ship within view.
If you leave your ship (not moving) it'll still stay on screen at the ship_min_x coordinate.

You can do the same for Y.

PS.: You can make it scalable to include a zooming and still get the same results. You just wont use a fixed number but variables, scaling around the Y axis of the camera. (Or Z axis, dunno wich one is towards your ship)

Last edited by EpsiloN; 12/04/13 11:53.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201