HUDClient

getRenderedCharacterHeight

GET_RENDERED_CHARACTER_HEIGHT0xDB88A37483346780

The GTA V native GET_RENDERED_CHARACTER_HEIGHT of the HUD namespace, as LS:MP client scripts call it: the global function getRenderedCharacterHeight, in JavaScript and in Lua.

SignatureJavaScript
getRenderedCharacterHeight(size: number, font: number): number
SignatureLua
getRenderedCharacterHeight(size: number, font: integer): number

Usage

JavaScript
const value = getRenderedCharacterHeight(size, font);
Lua
local value = getRenderedCharacterHeight(size, font)

Parameters

ParameterTypeJavaScriptLua
sizefloatnumbernumber
fontintnumberinteger

Returns

float JavaScript number, Lua number

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This gets the height of the FONT and not the total text. You need to get the number of lines your text uses, and get the height of a newline (I'm using a smaller value) to get the total text height.

Reference

Namespace
HUD HUD
In the game
float GET_RENDERED_CHARACTER_HEIGHT(float size, int font)
Hash
0xDB88A37483346780
Formerly
_GET_TEXT_SCALE_HEIGHT

Open in the interactive natives reference