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

Method Draw

src/openrct2/drawing/Text.cpp:41–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 void Draw(RenderTarget& rt, const ScreenCoordsXY& coords)
42 {
43 TextPaint tempPaint = Paint;
44
45 auto lineCoords = coords;
46 switch (Paint.alignment)
47 {
48 case TextAlignment::left:
49 break;
50 case TextAlignment::centre:
51 lineCoords.x += MaxWidth / 2;
52 break;
53 case TextAlignment::right:
54 lineCoords.x += MaxWidth;
55 break;
56 }
57 const utf8* buffer = Buffer.data();
58 for (int32_t line = 0; line < LineCount; ++line)
59 {
60 drawText(rt, lineCoords, buffer, tempPaint);
61 tempPaint.colour = OpenRCT2::Drawing::kColourNull;
62 buffer = GetStringEnd(buffer) + 1;
63 lineCoords.y += LineHeight;
64 }
65 }
66
67 int32_t GetHeight() const
68 {

Callers 1

drawTextWrappedFunction · 0.45

Calls 3

drawTextFunction · 0.85
GetStringEndFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected