BIS fnc createTooltip: Difference between revisions
Jump to navigation
Jump to search
(Page overhaul. Added examples) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
|gr1= GUI | |gr1= GUI | ||
|descr= Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings. | |descr= Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings. | ||
[[File:a3 bis fnc createTooltip.jpg|300px|right]] | |||
|s1= [input, display, mousePos] call [[BIS_fnc_createTooltip]] | |s1= [input, display, mousePos] call [[BIS_fnc_createTooltip]] | ||
|p1= input: [[Array]] | |p1= input: [[Array]] format [config, parameters]: | ||
* | * config: [[Config]] - group from CfgORBAT | ||
* | * parameters: [[Array]] - group params returned by [[BIS_fnc_ORBATGetGroupParams]] | ||
|p2= display: [[Display]] - | |p2= display: [[Display]] - display where tooltip controls group is created | ||
|p3= mousePos: [[Array]] - | |p3= mousePos: [[Array]] - mouse position in format [x, y] | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= <sqf>// enable icons in 2D and 3D | |x1= <sqf> | ||
setGroupIconsVisible [true, true]; | // enable icons in 2D and 3D | ||
setGroupIconsSelectable true; | setGroupIconsVisible [true, true]; | ||
setGroupIconsSelectable true; | |||
// add the icon for all existing groups | |||
private _group = group player; | // add the icon for all existing groups | ||
private _color = [side _group, false] call BIS_fnc_sideColor; | private _group = group player; | ||
_group addGroupIcon ["o_inf", [0, 0]]; | private _color = [side _group, false] call BIS_fnc_sideColor; | ||
_group setGroupIconParams [_color, groupID _group, 1, true]; | _group addGroupIcon ["o_inf", [0, 0]]; | ||
_group setGroupIconParams [_color, groupID _group, 1, true]; | |||
// show tooltip when hovering over group icon of player group | // show tooltip when hovering over group icon of player group | ||
addMissionEventHandler ["GroupIconOverEnter", | addMissionEventHandler ["GroupIconOverEnter", | ||
{ | { | ||
[configFile >> "CfgORBAT" >> "BIS" >> "I_AAF", findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; | |||
}]; | |||
}]; | |||
// remove tooltip when leaving group icon area | // remove tooltip when leaving group icon area | ||
addMissionEventHandler ["GroupIconOverLeave", | addMissionEventHandler ["GroupIconOverLeave", | ||
{ | { | ||
[nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip; | |||
}]; | |||
</sqf> | |||
}];</sqf> | |||
|x2= <sqf>_marker = createMarker ["marker_0", [worldSize / 2, worldSize / 2]]; | |x2= <sqf> | ||
private _marker = createMarker ["marker_0", [worldSize / 2, worldSize / 2]]; | |||
_marker setMarkerType "flag_Germany"; | _marker setMarkerType "flag_Germany"; | ||
_marker setMarkerText "GERMANY"; | _marker setMarkerText "GERMANY"; | ||
Line 61: | Line 53: | ||
_marker setMarkerText "ALTIS"; | _marker setMarkerText "ALTIS"; | ||
findDisplay 12 displayCtrl 51 ctrlAddEventHandler | 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> | ]; | ||
</sqf> | |||
|seealso= [[BIS_fnc_ORBATGetGroupParams]] | |seealso= [[BIS_fnc_ORBATGetGroupParams]] | ||
}} | }} |
Latest revision as of 00:22, 12 February 2024
Description
- Description:
- Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings.
- Execution:
- call
- Groups:
- GUI
Syntax
- Syntax:
- [input, display, mousePos] call BIS_fnc_createTooltip
- Parameters:
- input: Array format [config, parameters]:
- config: Config - group from CfgORBAT
- parameters: Array - group params returned by BIS_fnc_ORBATGetGroupParams
- 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