T3D 1.1 Final - GuiMouseEventCtrl doesn't get correct parameters - RESOLVED (THREED-2471)
by Lunacy · in Torque 3D Professional · 08/15/2011 (12:41 am) · 2 replies
Hello,
Build: 1.1 F
Platform: Seven 64b
Target: GUI/mouse handling
Issue: GuiMouseEventCtrl callbacks, which should normally get 3 different parameters (U8 modifier, Point2I mousePoint, U8 mouseClickCount), receive 3 times the same value (which is U8 mouseClickCount)
Steps to repeat:
1- Add this GuiMouseEventCtrl to the default PlayGui in art/gui/PlayGui.gui on a full template project:
4- Launch the game
5- Click in various places, and get only the %mouseClickCount replicated 3 times in the console for each click
I also wanted to add that the "RTS Prototype" tutorial makes us add a "function PlayGui::onRightMouseDown(%this, %pos, %start, %ray)" callback which, according to the doc (and the .dump() command) is not supposed to exist for this class (GameTSCtrl), so I guess this tutorial is partly outdated since the release of 1.1F.
Thanks for your time.
Build: 1.1 F
Platform: Seven 64b
Target: GUI/mouse handling
Issue: GuiMouseEventCtrl callbacks, which should normally get 3 different parameters (U8 modifier, Point2I mousePoint, U8 mouseClickCount), receive 3 times the same value (which is U8 mouseClickCount)
Steps to repeat:
1- Add this GuiMouseEventCtrl to the default PlayGui in art/gui/PlayGui.gui on a full template project:
new GuiMouseEventCtrl(myMouseEvent) {
lockMouse = "0";
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "relative";
vertSizing = "relative";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};2- Add this callback after the declaration of PlayGui:function myMouseEvent::onMouseDown(%this, %modifier, %mousePoint, %mouseClickCount){
echo(%modifier);
echo(%mousePoint);
echo(%mouseClickCount);
}3- Change the "noCursor" attribute of PlayGui to "0"4- Launch the game
5- Click in various places, and get only the %mouseClickCount replicated 3 times in the console for each click
I also wanted to add that the "RTS Prototype" tutorial makes us add a "function PlayGui::onRightMouseDown(%this, %pos, %start, %ray)" callback which, according to the doc (and the .dump() command) is not supposed to exist for this class (GameTSCtrl), so I guess this tutorial is partly outdated since the release of 1.1F.
Thanks for your time.
About the author
Torque 3D Owner Christopher Tauscher
Default Studio