MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / frame

Method frame

switch/source/ScriptTile.cpp:40–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40int ScriptTile::frame(int x, int y, int w, int h, const std::string& title, const std::string& note)
41{
42 card(x, y, w, h);
43
44 int noteW = 0;
45 if (!note.empty()) {
46 u32 nw, nh;
47 Gfx::GetTextDimensions(NOTE_SIZE, note.c_str(), &nw, &nh);
48 Gfx::DrawText(NOTE_SIZE, x + w - PAD - (int)nw, y + PAD + 6, COLOR_TEXT3, note.c_str());
49 noteW = (int)nw + 16; // gap between the title and the note
50 }
51
52 const std::string fitted = trimToFit(title, w - 2 * PAD - noteW, TITLE_SIZE);
53 Gfx::DrawText(TITLE_SIZE, x + PAD, y + PAD, COLOR_TEXT, fitted.c_str());
54
55 const int lineY = y + HEADER_H;
56 Gfx::DrawRect(x + PAD, lineY, w - 2 * PAD, 1, COLOR_STROKE1);
57 return lineY + 18;
58}
59
60void ScriptTile::hints(int x, int y, int w, const std::string& text)
61{

Callers

nothing calls this directly

Calls 2

trimToFitFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected