Mouse Events
by Steve De George · in Torque X 2D · 01/05/2007 (12:18 pm) · 4 replies
How do I get mouse events trapped when the user is moving the mouse over torque objects?
About the author
#2
01/17/2007 (11:10 am)
Which specific events are you looking for? Currently you can bind mouse movements as well as clicks and scrollwheel through the TXE input system, but if you want to have mouse events for controls themselves, you'll have to roll your own (like an onClick event for a GUIButton)
#3
In TGB scripting, you could set up and object to respond to mouse events. If you defined an "OnMouseDown" event for the object, it would get called when you clicked that object. Easy peasy.
So, I was hoping for that kind of functionality, but I didn't see any obvious way to do it. So, as you say, I guess I'd have to roll my own.
Thanks!
Adman
01/17/2007 (11:41 am)
First, please note that I just downloaded TorqueX last night (and bought TGB a couple weeks ago). So I'm pretty new.In TGB scripting, you could set up and object to respond to mouse events. If you defined an "OnMouseDown" event for the object, it would get called when you clicked that object. Easy peasy.
So, I was hoping for that kind of functionality, but I didn't see any obvious way to do it. So, as you say, I guess I'd have to roll my own.
Thanks!
Adman
#4
01/17/2007 (12:06 pm)
@Adam - Yes, you could set up mouse events in TGB and all the other engines for that matter, but in TXE it doesn't currently exist. My guess is that this is mostly due to the fact that TXE is geared towards Xbox360, secondly because they focused on 2D first and the mouse isnt' as crucial in most 2D games as it is in 3D games.
Torque Owner Adam Spragg
Anyone...?