BIS fnc createTooltip: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (infobox to template)
m (Some wiki formatting)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
|game1= arma3
|version1= 1.78


| arma3 |Game name=
|gr1= GUI


|1.78|Game version=
|descr= Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings.


<!---|arg= local |Multiplayer Arguments=--->
[[File:a3 bis fnc createTooltip.jpg|300px|right]]
|s1= [input, display, mousePos] call [[BIS_fnc_createTooltip]]


<!---|eff= local |Multiplayer Effects=--->
|p1= input: [[Array]] format [config, parameters]:
* config: [[Config]] - group from CfgORBAT
* parameters: [[Array]] - group params returned by [[BIS_fnc_ORBATGetGroupParams]]


| <pre>/*
|p2= display: [[Display]] - display where tooltip controls group is created
Author: Karel Moricky, modified by Riccardo Argiolas


Description:
|p3= mousePos: [[Array]] - mouse position in format [x, y]
Show group tooltip.
Modifications:
Adapted for Tac Ops DLC for use in the animated briefings.


Parameter(s):
|r1= [[Boolean]]
0:
CONFIG - group from CfgORBAT
ARRAY - group params returned by BIS_fnc_ORBATGetGroupParams
1: CONTROL - tooltip control
2: ARRAY - mouse position in format [x,y]


Returns:
|x1= <sqf>
BOOL
// enable icons in 2D and 3D
*/</pre>{{placeholder}}<!-- Remove this after fill-in --> |Description=
setGroupIconsVisible [true, true];
setGroupIconsSelectable true;


|[] call [[BIS_fnc_createTooltip]]|Syntax=
// add the icon for all existing groups
private _group = group player;
private _color = [side _group, false] call BIS_fnc_sideColor;
_group addGroupIcon ["o_inf", [0, 0]];
_group setGroupIconParams [_color, groupID _group, 1, true];


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
// show tooltip when hovering over group icon of player group
addMissionEventHandler ["GroupIconOverEnter",
{
[configFile >> "CfgORBAT" >> "BIS" >> "I_AAF", findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;
}];


|Datatype - description|Return value=
// remove tooltip when leaving group icon area
addMissionEventHandler ["GroupIconOverLeave",
{
[nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;
}];
</sqf>


|x1= <code></code>|Example 1=
|x2= <sqf>
private _marker = createMarker ["marker_0", [worldSize / 2, worldSize / 2]];
_marker setMarkerType "flag_Germany";
_marker setMarkerText "GERMANY";


|exec= call |Execution=
_marker = createMarker ["marker_1", [worldSize / 1.5, worldSize / 1.5]];
_marker setMarkerType "flag_Altis";
_marker setMarkerText "ALTIS";


| |See also=
findDisplay 12 displayCtrl 51 ctrlAddEventHandler
[
"draw",
{
params ["_ctrlMap"];
 
ctrlMapMouseOver _ctrlMap params [["_type", ""], ["_markerName", ""]];
 
if (_type == "marker") then
{
private _markerTexture = getText (configFile >> "CfgMarkers" >> markerType _markerName >> "icon");
private _markerText = markerText _markerName;
 
[[nil, nil, _markerName, nil, _markerTexture, nil, nil, nil, _markerText, nil, nil, "Some Description"], findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;
}
else
{
[nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;
};
}
];
</sqf>
 
|seealso= [[BIS_fnc_ORBATGetGroupParams]]
}}
}}
[[Category:Function Group: Systems|{{uc:createTooltip}}]]
[[Category:Functions|{{uc:createTooltip}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:createTooltip}}]]

Latest revision as of 00:22, 12 February 2024

Hover & click on the images for description

Description

Description:
Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings.
a3 bis fnc createTooltip.jpg
Execution:
call
Groups:
GUI

Syntax

Syntax:
[input, display, mousePos] call BIS_fnc_createTooltip
Parameters:
input: Array format [config, parameters]:
display: Display - display where tooltip controls group is created
mousePos: Array - mouse position in format [x, y]
Return Value:
Boolean

Examples

Example 1:
// enable icons in 2D and 3D setGroupIconsVisible [true, true]; setGroupIconsSelectable true; // add the icon for all existing groups private _group = group player; private _color = [side _group, false] call BIS_fnc_sideColor; _group addGroupIcon ["o_inf", [0, 0]]; _group setGroupIconParams [_color, groupID _group, 1, true]; // show tooltip when hovering over group icon of player group addMissionEventHandler ["GroupIconOverEnter", { [configFile >> "CfgORBAT" >> "BIS" >> "I_AAF", findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; }]; // remove tooltip when leaving group icon area addMissionEventHandler ["GroupIconOverLeave", { [nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; }];
Example 2:
private _marker = createMarker ["marker_0", [worldSize / 2, worldSize / 2]]; _marker setMarkerType "flag_Germany"; _marker setMarkerText "GERMANY"; _marker = createMarker ["marker_1", [worldSize / 1.5, worldSize / 1.5]]; _marker setMarkerType "flag_Altis"; _marker setMarkerText "ALTIS"; findDisplay 12 displayCtrl 51 ctrlAddEventHandler [ "draw", { params ["_ctrlMap"]; ctrlMapMouseOver _ctrlMap params [["_type", ""], ["_markerName", ""]]; if (_type == "marker") then { private _markerTexture = getText (configFile >> "CfgMarkers" >> markerType _markerName >> "icon"); private _markerText = markerText _markerName; [[nil, nil, _markerName, nil, _markerTexture, nil, nil, nil, _markerText, nil, nil, "Some Description"], findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; } else { [nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; }; } ];

Additional Information

See also:
BIS_fnc_ORBATGetGroupParams

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