Moving the screen with the mouse
by Steve D · in RTS Starter Kit · 12/27/2007 (7:16 am) · 3 replies
Hi all, can anyone give me any info on the rts function where you move the mouse to the edge of the screen and the screen / camera moves in that direction? Is that part of the rts camera, rts ts control, script only or a combo of those? Any info on where this functionality is located would be appreciated.
#2
{
get { return Owner as T2DSceneObject; }
}
private Camera camera;
private MouseHandler mouse;
public virtual void ProcessTick(Move move, float dt)
{
if (mouse.GetPosition().Y <= camera.getPosition().Y - 30)
{
camera.moveCameraUp();
}
if (mouse.GetPosition().Y >= camera.getPosition().Y + 30)
{
camera.moveCameraDown();
}
if (mouse.GetPosition().X >= camera.getPosition().X + 30 )
{
camera.moveCameraLeft();
}
if (mouse.GetPosition().X <= camera.getPosition().X - 30)
{
camera.moveCameraRight();
}
//if (TorqueEvent<TorqueInputDevice.InputEventData>k
}
public virtual void InterpolateTick(float k)
{
// todo: interpolate between ticks as needed here
}
public override void CopyTo(TorqueComponent obj)
{
base.CopyTo(obj);
}
02/16/2009 (11:09 am)
public T2DSceneObject SceneObject{
get { return Owner as T2DSceneObject; }
}
private Camera camera;
private MouseHandler mouse;
public virtual void ProcessTick(Move move, float dt)
{
if (mouse.GetPosition().Y <= camera.getPosition().Y - 30)
{
camera.moveCameraUp();
}
if (mouse.GetPosition().Y >= camera.getPosition().Y + 30)
{
camera.moveCameraDown();
}
if (mouse.GetPosition().X >= camera.getPosition().X + 30 )
{
camera.moveCameraLeft();
}
if (mouse.GetPosition().X <= camera.getPosition().X - 30)
{
camera.moveCameraRight();
}
//if (TorqueEvent<TorqueInputDevice.InputEventData>k
}
public virtual void InterpolateTick(float k)
{
// todo: interpolate between ticks as needed here
}
public override void CopyTo(TorqueComponent obj)
{
base.CopyTo(obj);
}
#3
Furthermore, what you just posted seems to be TGB code, which is not related in any way with this RTS kit (besides beeing prohibited by the Torque licensing).
02/17/2009 (4:31 am)
Everton, please dont throw a code dump on a post without explanation.Furthermore, what you just posted seems to be TGB code, which is not related in any way with this RTS kit (besides beeing prohibited by the Torque licensing).
Torque 3D Owner Novack
CyberianSoftware