Biiiiiiiind Action: Zoooooom
by Zilla · in Torque X 2D · 08/02/2008 (1:33 pm) · 2 replies
I created a zoom function that works fine.
Now I wanted to do this:
As long as I hold the X key, the zooming should continue.
I remember that I should use BindAction for this.
I added:
And just after the protected void _setupInputMap() function:
It zooms, but not continuously: I have to hit the X button again and again to zoom in deltaZoom steps.
Now I wanted to do this:
As long as I hold the X key, the zooming should continue.
I remember that I should use BindAction for this.
I added:
inputMap.BindAction(keyboardId, (int)Keys.X, _ZoomOutButtonPressed); //ZoomOut
And just after the protected void _setupInputMap() function:
protected virtual void _ZoomOutButtonPressed(float val)
{
if (val == 1.0f)
{
camera = TorqueObjectDatabase.Instance.FindObject<T2DSceneCamera>("Camera");
camera.Extent += deltaZoom;
}
}It zooms, but not continuously: I have to hit the X button again and again to zoom in deltaZoom steps.
#2
I found the thread that I remembered:
www.garagegames.com/mg/forums/result.thread.php?qt=68333
Doesn't it say something different?
08/03/2008 (12:25 pm)
It didn't work. The method is called only once.I found the thread that I remembered:
www.garagegames.com/mg/forums/result.thread.php?qt=68333
Doesn't it say something different?
Associate John Kanalakis
EnvyGames
John K.