Game Development Community

Help - Rotate Cam like the WE

by Chico Hermida · in Torque 3D Professional · 10/10/2009 (7:23 am) · 3 replies

Hi, i'm a beginner with Torque 3D, anyone can help me with something to guide me in a way to rotate the camera in the game mode, like in the world editor mode?

I read the RTS Prototype docs and i found the code to show the mouse cursorr noCursor = "0"; in the "playgui.gui" file

After this i can see the cursor, but i want rotate the screen using the cursor while the righmousebutton is down, to do this now i need to include a toggle mouse cursor function, that hide the cursor so i can rotate moving the mouse only without any button.

I tried all this week find how to do this and searched a lot of threads, but i couldn't find ;/, if there someone to help me with this, i would be very greatfully.

This is the last thing that i need to conclude my simple project.

Thanks.

Chico Hermida

#1
10/10/2009 (2:45 pm)
Not sure what WE is but you could look at EditTSCtrl source code. That is what the RTSTSCtrl in the RTS Kit is based on.
#2
10/10/2009 (8:35 pm)
Hi Matt, WE = world editor. I will look this source didn't tried this one before!

Thanks
#3
10/11/2009 (4:30 am)
I changed the file scripts/gui/plaGui.cs added this code:

function PlayGui::onRightMouseDown(%this, %pos, %start, %ray)
{
   GlobalActionMap.bind( mouse, "xaxis", Yaw );
   GlobalActionMap.bind( mouse, "yaxis", Pitch );
}

function PlayGui::onRightMouseUp(%this, %pos, %start, %ray)
{
   GlobalActionMap.unbind( mouse, "xaxis");
   GlobalActionMap.unbind( mouse, "yaxis");
}

this code solved my problem, but gave me another one, I have some buttons in my playgui, and after when I use the right mouse button, I'm not able anymore to use those buttons even the main menu buttons.

next step is try to drag the camera around (x,y plane) relative to the cursor using the mouse1 button