Difference between revisions of "ctrlMapCursor"

From Bohemia Interactive Community
Jump to navigation Jump to search
m
m (template:command argument fix)
Line 31: Line 31:
 
| control '''ctrlMapCursor''' [defaultCursor, newCursor] |= Syntax
 
| control '''ctrlMapCursor''' [defaultCursor, newCursor] |= Syntax
  
|p1= control: [[Control]] - Map control |= PARAMETER1
+
|p1= control: [[Control]] - Map control |PARAMETER1=  
  
|p2= defaultCursor: [[String]] - Cursor class name |= PARAMETER2
+
|p2= defaultCursor: [[String]] - Cursor class name |PARAMETER2=  
  
|p3= newCursor: [[String]] - Cursor class name |= PARAMETER3
+
|p3= newCursor: [[String]] - Cursor class name |PARAMETER3=  
  
| [[Nothing]] |= RETURNVALUE
+
| [[Nothing]] |RETURNVALUE=  
  
  
|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>|= EXAMPLE1
+
|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>|EXAMPLE1=  
  
 
|x2= <code>[[uiNamespace]] [[setVariable]] ["_map",[[findDisplay]] 12 [[displayCtrl]] 51];
 
|x2= <code>[[uiNamespace]] [[setVariable]] ["_map",[[findDisplay]] 12 [[displayCtrl]] 51];
([[uiNamespace]] [[getVariable]] "_map") [[ctrlMapCursor]] ["Track","HC_overFriendly"];</code>|= EXAMPLE2
+
([[uiNamespace]] [[getVariable]] "_map") [[ctrlMapCursor]] ["Track","HC_overFriendly"];</code>|EXAMPLE2=  
  
|x3= <code>[[findDisplay]] 12 [[displayCtrl]] 51 [[ctrlMapCursor]] ["Scroll", "Wait"];</code>|= EXAMPLE3
+
|x3= <code>[[findDisplay]] 12 [[displayCtrl]] 51 [[ctrlMapCursor]] ["Scroll", "Wait"];</code>|EXAMPLE3=
  
 
|x4= Cycle through all available cursors over custom map:<code>0 = [] [[spawn]]  
 
|x4= Cycle through all available cursors over custom map:<code>0 = [] [[spawn]]  
Line 59: Line 59:
 
}  
 
}  
 
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));
 
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));
};</code>|= EXAMPLE4
+
};</code>|EXAMPLE4=
  
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| [[setMousePosition]], [[getMousePosition]] |= SEEALSO
+
| [[setMousePosition]], [[getMousePosition]] |SEEALSO=  
  
|  |= MPBEHAVIOUR
+
|  |MPBEHAVIOUR=  
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 
}}
 
}}

Revision as of 11:30, 7 April 2019

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"]; }; }];