Zooming Camera / keeping objects on screen
by Andy S. · in Torque X 2D · 04/05/2008 (6:23 am) · 0 replies
Hi,
in my game, each of the two players controls a sceneobject which is an animated sprite. This works fine now, because my level is not bigger than the camera area. It's all based on the rainyday example. Now, i want to make my level much bigger, maybe 4 times the size of the camera area. How can i zoom the camera, that always both players are visible on the screen? Does anyone have some sample code? I saw there are possibilities to zoom the camera, but i don't know really how to use it. I only managed to get the camra moving together with one player, but obvousely it's not what i need, cuz the other gets offscrenn then.
A small code example would be highly appreciated.
andi
in my game, each of the two players controls a sceneobject which is an animated sprite. This works fine now, because my level is not bigger than the camera area. It's all based on the rainyday example. Now, i want to make my level much bigger, maybe 4 times the size of the camera area. How can i zoom the camera, that always both players are visible on the screen? Does anyone have some sample code? I saw there are possibilities to zoom the camera, but i don't know really how to use it. I only managed to get the camra moving together with one player, but obvousely it's not what i need, cuz the other gets offscrenn then.
A small code example would be highly appreciated.
andi