{"name":"BIS_fnc_createTooltip","title":"BIS fnc createTooltip","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_createTooltip","revid":352466,"updated":"2024-02-11T23:22:48Z","groups":["GUI"],"status":"ok","games":{"arma3":"1.78"},"since":"arma3 1.78","arma3_since":"1.78","description":"Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings.","syntaxes":[{"syntax":"[input, display, mousePos] call BIS_fnc_createTooltip","params":[{"name":"input","type":"Array format [config, parameters]:","description":"Array format [config, parameters]:\n\n- config: Config - group from CfgORBAT\n- parameters: Array - group params returned by BIS_fnc_ORBATGetGroupParams","type_expr":"Array","text":"input: Array format [config, parameters]:\n\n- config: Config - group from CfgORBAT\n- parameters: Array - group params returned by BIS_fnc_ORBATGetGroupParams"},{"name":"display","type":"Display","description":"display where tooltip controls group is created","type_expr":"Display"},{"name":"mousePos","type":"Array","description":"mouse position in format [x, y]","type_expr":"Array"}],"returns":{"type":"Boolean","type_expr":"Boolean"}}],"examples":[{"text":"```sqf\n// enable icons in 2D and 3D\nsetGroupIconsVisible [true, true];\nsetGroupIconsSelectable true;\n\n// add the icon for all existing groups\nprivate _group = group player;\nprivate _color = [side _group, false] call BIS_fnc_sideColor;\n_group addGroupIcon [\"o_inf\", [0, 0]];\n_group setGroupIconParams [_color, groupID _group, 1, true];\n\n// show tooltip when hovering over group icon of player group\naddMissionEventHandler [\"GroupIconOverEnter\",\n{\n    [configFile >> \"CfgORBAT\" >> \"BIS\" >> \"I_AAF\", findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n}];\n\n// remove tooltip when leaving group icon area\naddMissionEventHandler [\"GroupIconOverLeave\",\n{\n    [nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n}];\n```","code":["// enable icons in 2D and 3D\nsetGroupIconsVisible [true, true];\nsetGroupIconsSelectable true;\n\n// add the icon for all existing groups\nprivate _group = group player;\nprivate _color = [side _group, false] call BIS_fnc_sideColor;\n_group addGroupIcon [\"o_inf\", [0, 0]];\n_group setGroupIconParams [_color, groupID _group, 1, true];\n\n// show tooltip when hovering over group icon of player group\naddMissionEventHandler [\"GroupIconOverEnter\",\n{\n\t[configFile >> \"CfgORBAT\" >> \"BIS\" >> \"I_AAF\", findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n}];\n\n// remove tooltip when leaving group icon area\naddMissionEventHandler [\"GroupIconOverLeave\",\n{\n\t[nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n}];"]},{"text":"```sqf\nprivate _marker = createMarker [\"marker_0\", [worldSize / 2, worldSize / 2]];\n_marker setMarkerType \"flag_Germany\";\n_marker setMarkerText \"GERMANY\";\n\n_marker = createMarker [\"marker_1\", [worldSize / 1.5, worldSize / 1.5]];\n_marker setMarkerType \"flag_Altis\";\n_marker setMarkerText \"ALTIS\";\n\nfindDisplay 12 displayCtrl 51 ctrlAddEventHandler\n[\n    \"draw\",\n    {\n        params [\"_ctrlMap\"];\n\n        ctrlMapMouseOver _ctrlMap params [[\"_type\", \"\"], [\"_markerName\", \"\"]];\n\n        if (_type == \"marker\") then\n        {\n            private _markerTexture = getText (configFile >> \"CfgMarkers\" >> markerType _markerName >> \"icon\");\n            private _markerText = markerText _markerName;\n\n            [[nil, nil, _markerName, nil, _markerTexture, nil, nil, nil, _markerText, nil, nil, \"Some Description\"], findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n        }\n        else\n        {\n            [nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n        };\n    }\n];\n```","code":["private _marker = createMarker [\"marker_0\", [worldSize / 2, worldSize / 2]];\n_marker setMarkerType \"flag_Germany\";\n_marker setMarkerText \"GERMANY\";\n\n_marker = createMarker [\"marker_1\", [worldSize / 1.5, worldSize / 1.5]];\n_marker setMarkerType \"flag_Altis\";\n_marker setMarkerText \"ALTIS\";\n\nfindDisplay 12 displayCtrl 51 ctrlAddEventHandler\n[\n\t\"draw\",\n\t{\n\t\tparams [\"_ctrlMap\"];\n\n\t\tctrlMapMouseOver _ctrlMap params [[\"_type\", \"\"], [\"_markerName\", \"\"]];\n\n\t\tif (_type == \"marker\") then\n\t\t{\n\t\t\tprivate _markerTexture = getText (configFile >> \"CfgMarkers\" >> markerType _markerName >> \"icon\");\n\t\t\tprivate _markerText = markerText _markerName;\n\n\t\t\t[[nil, nil, _markerName, nil, _markerTexture, nil, nil, nil, _markerText, nil, nil, \"Some Description\"], findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t[nil, findDisplay 12, getMousePosition] call BIS_fnc_createTooltip;\n\t\t};\n\t}\n];"]}],"see_also":["BIS_fnc_ORBATGetGroupParams"]}