MCPcopy Create free account
hub / github.com/DFHack/dfhack / paintString

Method paintString

library/modules/Screen.cpp:367–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367bool Screen::paintString(const Pen &pen, int x, int y, const std::string &text, bool map)
368{
369 auto dim = getWindowSize();
370 if (!gps || y < 0 || y >= dim.y) return false;
371
372 Pen tmp(pen);
373 bool ok = false;
374
375 for (size_t i = -std::min(0,x); i < text.size(); i++)
376 {
377 if (x + i >= size_t(dim.x))
378 break;
379
380 tmp.ch = text[i];
381 tmp.tile = (pen.tile ? pen.tile + uint8_t(text[i]) : 0);
382 paintTile(tmp, x+i, y, map);
383 ok = true;
384 }
385
386 return ok;
387}
388
389bool Screen::fillRect(const Pen &pen, int x1, int y1, int x2, int y2, bool map)
390{

Callers

nothing calls this directly

Calls 2

paintTileFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected