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

Function ttfDrawString

src/openrct2/drawing/Drawing.String.cpp:755–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753 }
754
755 TextColours ttfDrawString(
756 RenderTarget& rt, u8string_view text, ColourWithFlags colour, const ScreenCoordsXY& coords, bool noFormatting,
757 FontStyle fontStyle, TextDarkness darkness)
758 {
759 TextDrawInfo info{};
760 info.fontStyle = fontStyle;
761 info.start = coords;
762 info.current = coords;
763 info.darkness = darkness;
764
765 if (LocalisationService_UseTrueTypeFont())
766 {
767 info.textDrawFlags.set(TextDrawFlag::ttf);
768 }
769
770 if (noFormatting)
771 {
772 info.textDrawFlags.set(TextDrawFlag::noFormatting);
773 }
774
775 info.palette = _savedTextPalette;
776 processInitialColour(colour, info);
777 processString(rt, text, info);
778 _savedTextPalette = info.palette;
779
780 rt.lastStringPos = info.current;
781
782 return info.palette;
783 }
784
785 int32_t getStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting)
786 {

Callers 1

drawTextFunction · 0.85

Calls 4

processInitialColourFunction · 0.85
processStringFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected