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

Method onDraw

src/openrct2-ui/windows/NetworkStatus.cpp:91–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 void onDraw(Drawing::RenderTarget& rt) override
92 {
93 WindowDrawWidgets(*this, rt);
94 thread_local std::string _buffer;
95
96 _buffer.assign("{WHITE}");
97 _buffer += _windowNetworkStatusText;
98 Drawing::clipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::medium);
99
100 ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2));
101 screenCoords.x -= Drawing::getStringWidth(_buffer, FontStyle::medium) / 2;
102 drawText(rt, screenCoords, _buffer, { Drawing::Colour::black });
103 }
104
105 void setCloseCallBack(CloseCallback callback)
106 {

Callers

nothing calls this directly

Calls 5

WindowDrawWidgetsFunction · 0.85
clipStringFunction · 0.85
getStringWidthFunction · 0.85
drawTextFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected