attachGui() Offset
by practicing01 · in Torque 2D Professional · 06/29/2013 (6:06 am) · 7 replies
https://github.com/practicing01/Torque2D/commit/5e7d09e07abd4a3206a90132fbaf15dbd25d0f0f
'Twas quite trivial.
'Twas quite trivial.
#2
06/29/2013 (10:46 am)
I tested it briefly. It's very possible that it will blow up and kill the user, as I don't know c++ well. If any bugs pop-up I'll update the thread.
#3
I simply inquired to know how deep we should test it before possibly integrating it. The code looks clean, I was just wondering if mouse input will be handled properly by the engine, i.e. taking the offset into account.
06/29/2013 (10:50 am)
User maiming is definitely next-gen, we should keep that in.I simply inquired to know how deep we should test it before possibly integrating it. The code looks clean, I was just wondering if mouse input will be handled properly by the engine, i.e. taking the offset into account.
#4
07/01/2013 (8:28 am)
Yea the input is being handled fine for the child buttons of the object. On a side note, how difficult would it be to be able to attach to multiple windows? My game switches from single to split camera quite often.
#5
Action:
07/03/2013 (9:06 am)
Another side note: is it possible to simulate mouse clicks? I use a joypad for the second player and need to click the gui based on a joypad button press.Action:
#6
The only way to perform a mouse click on a GuiButton is as follows
Aside from this, if you're trying to hijack the 'OnMouseDown' function, all it does is take the current position of the mouse and then execute standard script calls based on this. For a joystick, a simple function in your actionMap should work, as long as it has a way to know where the joystick cursor is at that moment.
07/03/2013 (10:28 am)
Cool vid!The only way to perform a mouse click on a GuiButton is as follows
ConsoleMethod( GuiButtonBaseCtrl, performClick, void, 2, 2, "() - simulates a button click from script." )
{
object->onAction();
}Aside from this, if you're trying to hijack the 'OnMouseDown' function, all it does is take the current position of the mouse and then execute standard script calls based on this. For a joystick, a simple function in your actionMap should work, as long as it has a way to know where the joystick cursor is at that moment.
#7
07/03/2013 (10:29 am)
Addendum : As you see from the pasted code above, adding a function to other Gui controls shouldn't be too hard if you need it.
Associate Simon Love
I'd have nothing against a pull request for this, have you tested it in 'real-life situations'?