MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawString

Method DrawString

src/newgrf_debug_gui.cpp:376–382  ·  view source on GitHub ↗

* Helper function to draw a string (line) in the window. * @param r The (screen) rectangle we must draw within * @param offset The offset (in lines) we want to draw for * @param string The string to draw */

Source from the content-addressed store, hash-verified

374 * @param string The string to draw
375 */
376 void DrawString(const Rect &r, int offset, const std::string &string) const
377 {
378 offset -= this->vscroll->GetPosition();
379 if (offset < 0 || offset >= this->vscroll->GetCapacity()) return;
380
381 ::DrawString(r.Shrink(WidgetDimensions::scaled.frametext).Shrink(0, offset * this->resize.step_height, 0, 0), string, TC_BLACK);
382 }
383
384 /**
385 * Helper function to draw the vehicle chain widget.

Callers 1

DrawMainPanelWidgetMethod · 0.95

Calls 4

GetPositionMethod · 0.80
ShrinkMethod · 0.80
DrawStringFunction · 0.70
GetCapacityMethod · 0.45

Tested by

no test coverage detected