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
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
#2
Thanks
10/10/2009 (8:35 pm)
Hi Matt, WE = world editor. I will look this source didn't tried this one before!Thanks
#3
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
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
Torque 3D Owner Matt Huston
Atomic Banzai Games