Difference between revisions of "ctrlMapCursor"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
+
{{Command
  
| arma2 |Game name=
+
| arma2
  
|1.00|Game version=
+
|1.00
  
|gr1= GUI Control - Map |GROUP1=
+
|gr1= GUI Control - Map
  
 
| Changes the default cursor that appears when interacting with a map control to a custom one. Use an empty string to restore the default cursor. If the specified cursor does not exist, the default is used and no error is produced. ( NOT in case of Arma 3. Using an empty string will result in an error: "No entry 'bin\config.bin/CfgWrapperUI/Cursors.' ). The cursor is the name of a config entry from ''CfgWrapperUI / Cursors''. This command has the following specifics:
 
| Changes the default cursor that appears when interacting with a map control to a custom one. Use an empty string to restore the default cursor. If the specified cursor does not exist, the default is used and no error is produced. ( NOT in case of Arma 3. Using an empty string will result in an error: "No entry 'bin\config.bin/CfgWrapperUI/Cursors.' ). The cursor is the name of a config entry from ''CfgWrapperUI / Cursors''. This command has the following specifics:
Line 26: Line 26:
 
* HC_overMission
 
* HC_overMission
 
* HC_unsel
 
* HC_unsel
'''NOTE1''': Cursor names are '''case sensitive'''.|DESCRIPTION=
+
'''NOTE1''': Cursor names are '''case sensitive'''.
  
| control '''ctrlMapCursor''' [defaultCursor, newCursor] |SYNTAX=
+
| control '''ctrlMapCursor''' [defaultCursor, newCursor]
  
|p1= control: [[Control]] - Map control |PARAMETER1=
+
|p1= control: [[Control]] - Map control
  
|p2= defaultCursor: [[String]] - Cursor class name |PARAMETER2=
+
|p2= defaultCursor: [[String]] - Cursor class name
  
|p3= newCursor: [[String]] - Cursor class name |PARAMETER3=
+
|p3= newCursor: [[String]] - Cursor class name
  
| [[Nothing]] |RETURNVALUE=
+
| [[Nothing]]
  
  
|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>|EXAMPLE1=
+
|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>
  
 
|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>
  
|x3= <code>[[findDisplay]] 12 [[displayCtrl]] 51 [[ctrlMapCursor]] ["Scroll", "Wait"];</code>|EXAMPLE3=
+
|x3= <code>[[findDisplay]] 12 [[displayCtrl]] 51 [[ctrlMapCursor]] ["Scroll", "Wait"];</code>
  
 
|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 58: Line 58:
 
}  
 
}  
 
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));
 
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));
};</code>|EXAMPLE4=
+
};</code>
  
  
| [[setMousePosition]], [[getMousePosition]] |SEEALSO=
+
| [[setMousePosition]], [[getMousePosition]]
  
 
|  |MPBEHAVIOUR=  
 
|  |MPBEHAVIOUR=  

Revision as of 01:27, 18 January 2021

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