Hud
constHud:object
Defined in: client/api.d.ts:7
Drives Mafia II’s native heads-up display for this client: the whole layer, hints and messages, the countdown timer, and the wanted, recognition and drunkenness widgets.
Type Declaration
Section titled “Type Declaration”clearRecognition()
Section titled “clearRecognition()”clearRecognition():
void
Empties the recognition/search meter.
Returns
Section titled “Returns”void
clearWantedLevel()
Section titled “clearWantedLevel()”clearWantedLevel():
void
Clears the wanted-level HUD icon.
Returns
Section titled “Returns”void
clearWantedTag()
Section titled “clearWantedTag()”clearWantedTag():
void
Hides the wanted-person HUD tag.
Returns
Section titled “Returns”void
destroyHint()
Section titled “destroyHint()”destroyHint(
tag):void
Removes a persistent HUD hint.
Parameters
Section titled “Parameters”number
Tag assigned when the persistent hint was shown.
Returns
Section titled “Returns”void
hide()
Section titled “hide()”hide():
void
Hides the native gameplay HUD.
Returns
Section titled “Returns”void
isVisible()
Section titled “isVisible()”isVisible():
boolean
Checks whether the native gameplay HUD layer is visible.
Returns
Section titled “Returns”boolean
True when the HUD layer is enabled.
setDrunkLevel()
Section titled “setDrunkLevel()”setDrunkLevel(
value):void
Applies the native temporary drunkenness effect, including camera shake and aim sway.
Parameters
Section titled “Parameters”number
Drunkenness from 0 for sober to 1 for fully drunk.
Returns
Section titled “Returns”void
setRecognition()
Section titled “setRecognition()”setRecognition(
value,instant?):void
Sets the recognition/search meter beside the minimap.
Parameters
Section titled “Parameters”number
Recognition level from 0 for empty to 1 for full.
instant?
Section titled “instant?”boolean
Whether the meter snaps to the value instead of animating; defaults to true.
Returns
Section titled “Returns”void
setVisible()
Section titled “setVisible()”setVisible(
visible):void
Sets visibility of the native gameplay HUD. A hide holds until the HUD is shown again; repeated calls are idempotent.
Parameters
Section titled “Parameters”visible
Section titled “visible”boolean
True to show the HUD; false to hide it.
Returns
Section titled “Returns”void
setWantedLevel()
Section titled “setWantedLevel()”setWantedLevel(
level):void
Sets the native wanted-level HUD icon.
Parameters
Section titled “Parameters”number
Wanted escalation level from 0 through 4.
Returns
Section titled “Returns”void
setWantedTag()
Section titled “setWantedTag()”setWantedTag(
shown):void
Sets visibility of the wanted-person HUD tag.
Parameters
Section titled “Parameters”boolean
Whether the native wanted-person icon is shown.
Returns
Section titled “Returns”void
show()
Section titled “show()”show():
void
Shows the native gameplay HUD.
Returns
Section titled “Returns”void
showHint()
Section titled “showHint()”showHint(
text,area?,color?,durationSeconds?,persist?,tag?):void
Shows a configurable native hint on the HUD.
Parameters
Section titled “Parameters”string
Hint text displayed on the HUD.
number
Native script-hint area identifier from 0 through 3; defaults to 0.
color?
Section titled “color?”number
ARGB color value; -1, the default, uses white.
durationSeconds?
Section titled “durationSeconds?”number
Display duration in seconds when the hint is not persistent; defaults to 5.
persist?
Section titled “persist?”boolean
Whether the hint remains until explicitly destroyed; defaults to false.
number
Caller-defined identifier used by destroyHint; use a non-zero value for persistent hints.
Returns
Section titled “Returns”void
showMessage()
Section titled “showMessage()”showMessage(
text,durationSeconds?):void
Shows a temporary native HUD message.
Parameters
Section titled “Parameters”string
Message displayed on the top HUD message line.
durationSeconds?
Section titled “durationSeconds?”number
How long the message remains visible, in seconds; defaults to 5.
Returns
Section titled “Returns”void
startTimer()
Section titled “startTimer()”startTimer(
seconds):void
Sets, shows, and starts the native countdown timer.
Parameters
Section titled “Parameters”seconds
Section titled “seconds”number
Initial countdown duration in seconds.
Returns
Section titled “Returns”void
stopTimer()
Section titled “stopTimer()”stopTimer():
void
Stops and hides the native countdown timer.
Returns
Section titled “Returns”void
