MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ChatStringWrappedGetHeight

Function ChatStringWrappedGetHeight

src/openrct2/interface/Chat.cpp:316–322  ·  view source on GitHub ↗

Wrap string without drawing, useful to get the height of a wrapped string. Almost the same as gfx_draw_string_left_wrapped

Source from the content-addressed store, hash-verified

314// Wrap string without drawing, useful to get the height of a wrapped string.
315// Almost the same as gfx_draw_string_left_wrapped
316int32_t ChatStringWrappedGetHeight(u8string_view args, int32_t width)
317{
318 int32_t numLines;
319 wrapString(FormatStringID(STR_STRING, args), width, FontStyle::medium, nullptr, &numLines);
320 const int32_t lineHeight = FontGetLineHeight(FontStyle::medium);
321 return lineHeight * (numLines + 1);
322}

Callers 1

ChatDrawFunction · 0.85

Calls 3

wrapStringFunction · 0.85
FormatStringIDFunction · 0.85
FontGetLineHeightFunction · 0.85

Tested by

no test coverage detected