{"name":"BIS_fnc_createTooltip","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.78"}],"since":{"game":"arma3","name":"Arma 3","version":"1.78"},"arma3_since":"1.78","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Shows group tooltip. Adapted for Tac Ops DLC for use in the animated briefings.","syntaxes":[{"syntax":"[input, display, mousePos] call BIS_fnc_createTooltip","since":null,"effect":null,"exec":null,"params":[{"name":"input","type":"Array format [config, parameters]:","optional":false,"default":null,"description":"Array format [config, parameters]:\n- config: Config - group from CfgORBAT\n- parameters: Array - group params returned by BIS_fnc_ORBATGetGroupParams","types":["Array"],"since":null,"text":"input: Array format [config, parameters]:\n- config: Config - group from CfgORBAT\n- parameters: Array - group params returned by BIS_fnc_ORBATGetGroupParams"},{"name":"display","type":"Display","optional":false,"default":null,"description":"display where tooltip controls group is created","types":["Display"],"since":null,"text":"display: Display - display where tooltip controls group is created"},{"name":"mousePos","type":"Array","optional":false,"default":null,"description":"mouse position in format [x, y]","types":["Array"],"since":null,"text":"mousePos: Array - mouse position in format [x, y]"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"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];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_ORBATGetGroupParams"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: GUI","Functions","Introduced with Arma 3 version 1.78"],"docblock":null,"filled_from_docblock":[]}