Game Development Community

How to zoom a mounted camera?

by Matthews_30 · in Torque Game Builder · 11/02/2005 (6:24 am) · 2 replies

Hi

I'm using the following function

sceneWindow2D.setTargetCameraZoom(10);

but, I get this error:

fxSceneWindow2D::setTargetCameraZoom - Cannot use this command when camera is mounted!

I'm creating an RPG with a walking character that have mounted the camera.

please, if someone knows how to resolve this, post it.

#1
11/02/2005 (7:34 am)
Just use the following code.

function Zoom(%obj, %amount)// how much zoom, which object do we put it on?
{
	SceneWindow2D.dismount();
	SceneWindow2D.setCurrentCameraZoom(%amount);
	SceneWindow2D.mount(%obj,"0 0", 5, true);
}

Then you could make a call like this:
zoom($player,3);
Hope this helps!

-Peter
#2
11/02/2005 (9:16 am)
Thanks peter! it works for me.