ctrlMapCursor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
mNo edit summary
Line 56: Line 56:
_map [[ctrlMapCursor]] ["", [[configName]] _x]; //<-- the actual usage
_map [[ctrlMapCursor]] ["", [[configName]] _x]; //<-- the actual usage
[[hint]] [[format]] ["Current cursor: %1", [[configName]] _x];
[[hint]] [[format]] ["Current cursor: %1", [[configName]] _x];
sleep 1;
[[sleep]] 1;
}  
}  
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));
[[forEach]] ("true" [[configClasses]] ([[configFile]] >> "CfgWrapperUI" >> "Cursors"));

Revision as of 17:29, 7 February 2016

Hover & click on the images for description

Description

Description:
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. The cursor is the name of a config entry from CfgWrapperUI / Cursors. This command has the following specifics:
  • When used on Main Map (findDisplay 12 displayCtrl 51) it is possible to override multiple default cursors. For example, while leaving default "Arrow" intact, it is possible to just override "Scroll" with lets say "Wait" (Example 3)
  • When used on a custom map, for example user made Mini Map, there is only one single cursor "" for everything (see Example 4 on how to override it)
Some possible class names:
  • Arrow
  • Track
  • Move
  • Scroll
  • Rotate
  • Track3D
  • Move3D
  • Rotate3D
  • Raise3D
  • Wait
  • HC_move
  • HC_overFriendly
  • HC_overEnemy
  • HC_overMission
  • HC_unsel
NOTE1: Cursor names are case sensitive.
Groups:
Uncategorised

Syntax

Syntax:
control ctrlMapCursor [defaultCursor, newCursor]
Parameters:
control: Control - Map control
defaultCursor: String - Cursor class name
newCursor: String - Cursor class name
Return Value:
Nothing

Examples

Example 1:
_map ctrlMapCursor ["Track", "Arrow"];
Example 2:
uiNamespace setVariable ["_map",findDisplay 12 displayCtrl 51]; (uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overFriendly"];
Example 3:
findDisplay 12 displayCtrl 51 ctrlMapCursor ["Scroll", "Wait"];
Example 4:
Cycle through all available cursors over custom map:0 = [] spawn { disableSerialization; _map = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscMapControl", -1]; _map ctrlSetPosition [0,0,1,1]; _map ctrlCommit 0; { _map ctrlMapCursor ["", configName _x]; //<-- the actual usage hint format ["Current cursor: %1", configName _x]; sleep 1; } forEach ("true" configClasses (configFile >> "CfgWrapperUI" >> "Cursors")); };

Additional Information

See also:
setMousePositiongetMousePosition

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section