ctrlMapCursor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
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...)
m (Text replacement - " <!-- (DIS)?CONTINUE Notes -->" to "")
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma2
| arma2
Line 37: Line 37:


| [[Nothing]]
| [[Nothing]]


|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>
|x1= <code>_map [[ctrlMapCursor]] ["Track", "Arrow"];</code>
Line 60: Line 59:
};</code>
};</code>


 
|seealso= [[setMousePosition]], [[getMousePosition]]
| [[setMousePosition]], [[getMousePosition]]
 
|  |MPBEHAVIOUR=
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>


{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
Line 80: Line 68:
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on February 8, 2016 - 22:43 (UTC)</dd>
<dd class="notedate">Posted on February 8, 2016 - 22:43 (UTC)</dd>
<dt class="note">[[User:Bull A|Bull A]]</dt>
<dt class="note">[[User:Bull A|Bull A]]</dt>
<dd class="note">
<dd class="note">
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 [[ctrlAddEventHandler]] ["MouseMoving",{
_control [[ctrlAddEventHandler]] ["MouseMoving",{
   _this [[params]] [
   _this [[params]] [
       ["_mapCtrl",[[controlNull]],[[[controlNull]]]],
       ["_mapCtrl",[[controlNull]],[[[controlNull]]]],
Line 106: Line 93:
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 01:50, 6 April 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
GUI Control - Map

Syntax

Syntax:
Syntax needed
Parameters:
control: Control - Map control
defaultCursor: String - Cursor class name
newCursor: String - Cursor class name
Return Value:
Return value needed

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