Game Development Community

No body is giving any reply, whats happening ?

by Playware · in Torque Game Engine Advanced · 12/29/2008 (7:46 pm) · 3 replies

Hi All,


Whats happening with my queries, I don't understand. I asked so many queries in this forum. But nobody given any reply. What could be the problem? Is it like that I am posting these query in wrong forum or something?




Pls. tell me somebody.



thnx.

#1
12/29/2008 (8:08 pm)
It appears many, though not all, of your messages get replies. I'll disect the last message you posted, and respond why it likely has no replies. Perhaps this will help.

Quote:
I am looking for the code to get concurrent mouse position in Gui for TGEA. Mouse Position I can get by calling canvas.getCursorPos();. But how I will get mouse position continiously.....like onUpdateScene in level........

This question doesn't make a lot of grammatical sense.Concurrent mouse position? How is that possible - are you running more than one mouse?

get mouse position continuously? like onUpdateScene in level? In what level? You mean like in TGB?

What I think you are asking is this:

I would like to get the position of the mouse and process it whenever it moves.

To which I would respond:

Edit your PlayGui.cs, and add this function:

function PlayGui::onMouseMove(%this)
{
   %MousePos = Canvas.getCursorPos();
}

But, I don't know if this is what you're actually asking. The thing is, your spelling and grammar look right. But they way it's all put together just doesn't make a lot of sense. Sorry.
#2
12/30/2008 (1:12 am)
Hi,


Sorry for my grammatical mistake if any . Thnx for repling. I was asking about TGEA . In gui I need mouse position whenever I move mouse. I am using this code onMouseMove(%this), but no result.


what next I can try? Any idea..........thnaks
#3
12/31/2008 (7:12 am)
Depending on what you are trying to accomplish, this may or may not be what you need. But if you just want the mouse position, then this is what you need to do. The issue with the OnMouseMove is that it is not exposed on the default TSCtrl. Open guiTSControl.h, and add this function declaration to the class:

virtual void onMouseMove(const GuiEvent&);

Now add the actual function to your GuiTSCtrl in guiTSControl.cpp:

bool GuiTSCtrl::onMouseMove(const GuiEvent& evt)
{
Con::executef(this, "onMouseMove");
return true;
}


Now there is another way to get the mouse movements - Which is probably better, if you are wanting it as part of the main screen - look at the default.bind.cs file, and you can find functions that are called when the mouse axis are moved, or the buttons pressed:

// MOUSE CONTROL //
moveMap.bind(mouse, xaxis, yaw);
moveMap.bind(mouse, yaxis, pitch);
moveMap.bind(mouse, button0, mouse_btn0);
moveMap.bind(mouse, button1, mouse_btn1);