Game Development Community

Mouse events in the game

by Tiago Correia · in Torque Game Engine · 05/17/2007 (4:42 am) · 3 replies

Hi,

I searched in the forums posts but i didn't find how to click with the mouse in a point and show me the positon of that point in the world or other events like select a house in the world with the mouse.
I know that i have to define a bind like moveMap.bind( mouse, button0, mousePosition ), but how can i define the function mousePosition to get what i want ? Or should i use mouse events like 'onMouseDown' or 'onMouseMove'?
Any help would be appreciated.

Regards,
Tiago

#1
05/17/2007 (5:50 am)
Hey Tiago. The first few code sections from the Object Selection v1.2 tutorial will get the answer you want.

Particularly, look at the implementation of getMouse3DVec and getMouse3DPos.

The rest of the resource is actual selection of a 3D object using the mouse.
#2
05/17/2007 (6:33 am)
Thank you very much Michael, i'll try that.

Best regards,
Tiago
#3
05/17/2007 (6:37 am)
Happy to help out.