Game Development Community

Help Needed: how to scroll camera when player reach borders?

by Jack Cicci · in General Discussion · 08/11/2008 (7:17 am) · 5 replies

My player walks around for the screen... I need to move camera a bit left when he reach left border, a bit up when he reach up border and so on...

thanks

#1
08/11/2008 (11:16 am)
Look at methods t2dSceneWindow has. You will see several for controlling the camera. As for detecting when the player is at a border, perhaps use worldlimit callbacks.
#2
08/11/2008 (11:27 am)
Ok... thanks... i'll try...
#3
08/12/2008 (3:22 am)
Tryed; but having problem: my worldlimit are beyond my cameraview (camera view area is 800x600 and worldlimit are 1024x768); now trying with "cameraposition"...
#4
08/12/2008 (11:37 am)
You should not use a camera area that large, the default settings of 100x75 will perform the best.

If your worldlimits are too large... then make them smaller?

They are easy to change from within the editor. After the view "moves" you will also need to reset the worldlimits (which are in scene-space), so look at the t2dSceneObject methods having to do with worldlimits.
#5
08/17/2008 (2:11 pm)
Thanks! now worldlimits are ok... (i'm really a newbie)