Difference between revisions of "ctrlMapCursor"

From Bohemia Interactive Community
Jump to navigation Jump to search
Line 91: Line 91:
 
When using this command, the cursor will change for the whole display, resulting in visual glitches. Adding the onMouseMoving event handler can help solve this problem:
 
When using this command, the cursor will change for the whole display, resulting in visual glitches. Adding the onMouseMoving event handler can help solve this problem:
 
<code>
 
<code>
_control addEventHandler ["MouseMoving",{
+
_control [[ctrlAddEventHandler]] ["MouseMoving",{
   _this params [
+
   _this [[params]] [
       ["_mapCtrl",controlNull,[controlNull]],
+
       ["_mapCtrl",[[controlNull]],[[[controlNull]]]],
 
       ["_xPos",-1,[0]],
 
       ["_xPos",-1,[0]],
 
       ["_yPos",-1,[0]],
 
       ["_yPos",-1,[0]],
       ["_mouseIn",false,[true]]
+
       ["_mouseIn",[[false]],[[[true]]]]
 
   ];
 
   ];
  
 
   if (_mouseIn) then {
 
   if (_mouseIn) then {
 
       // Mouse is in control area
 
       // Mouse is in control area
       _mapCtrl ctrlMapCursor ["","Track"];
+
       _mapCtrl [[ctrlMapCursor]] ["","Track"];
 
   } else {
 
   } else {
 
       // Mouse is out of control area, goes back to arrow
 
       // Mouse is out of control area, goes back to arrow
       _mapCtrl ctrlMapCursor ["","Arrow"];
+
       _mapCtrl [[ctrlMapCursor]] ["","Arrow"];
 
   };
 
   };
 
}];
 
}];

Revision as of 13:52, 17 February 2016

Template:Command

Notes

Bottom Section

Posted on February 8, 2016 - 22:43 (UTC)
Bull A
When using this command, the cursor will change for the whole display, resulting in visual glitches. Adding the onMouseMoving event handler can help solve this problem: _control ctrlAddEventHandler ["MouseMoving",{ _this params [ ["_mapCtrl",controlNull,[[[controlNull]]]], ["_xPos",-1,[0]], ["_yPos",-1,[0]], ["_mouseIn",false,[[[true]]]] ]; if (_mouseIn) then { // Mouse is in control area _mapCtrl ctrlMapCursor ["","Track"]; } else { // Mouse is out of control area, goes back to arrow _mapCtrl ctrlMapCursor ["","Arrow"]; }; }];