Arma 3 Scripting

BIS_fnc_shakeMapEH

  • Arma 3 v1.78

Function · also in Event Handlers · Markdown · JSON · original wiki page

Description

Event handler function of BIS_fnc_shakeMap. BIS_fnc_shakeMap adds it as a "Draw" event handler to the main map control (display 12, control 51), so it runs every frame the map is drawn. While the shake lasts, it moves the map view to a random point within magnitude metres of the shake center on both axes; the movement fades out during the last quarter of the duration. When the duration has elapsed, it removes the event handler whose ID is stored in the BIS_shakeMapEventId variable of missionNamespace. It is meant for internal use; use BIS_fnc_shakeMap to shake the map.

Syntax

[duration, magnitude, center, startTime] call BIS_fnc_shakeMapEH

Parameters:

Returns: Nothing

Examples

Example 1

How BIS_fnc_shakeMap adds the handler:

private _map = findDisplay 12 displayCtrl 51;
private _code = format ["[%1, %2, %3, %4] call BIS_fnc_shakeMapEH", 2, 20, getPosWorld player, time];
BIS_shakeMapEventId = _map ctrlAddEventHandler ["Draw", _code];

See also

BIS_fnc_shakeMap · ctrlMapAnimAdd · ctrlAddEventHandler