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

Method uiFrame

3ds/source/ScriptTile.cpp:47–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47int ScriptTile::uiFrame(const std::string& title, const std::string& note, u32 outline, float z)
48{
49 TextPool& text = TextPool::get();
50 card(UI_X, UI_Y, UI_W, UI_H, outline, z);
51
52 float noteW = 0.0f;
53 if (!note.empty()) {
54 noteW = text.width(note, NOTE_SIZE);
55 text.draw(note, UI_X + UI_W - PAD - noteW, UI_Y + PAD + 2, NOTE_SIZE, COLOR_FAINT, z);
56 noteW += 8; // gap between the title and the note
57 }
58 const float titleMax = UI_W - 2 * PAD - noteW;
59 text.draw(text.truncate(title, titleMax, TITLE_SIZE), UI_X + PAD, UI_Y + PAD - 2, TITLE_SIZE, COLOR_TEXT, z);
60
61 const int lineY = UI_Y + HEADER_H;
62 C2D_DrawRectSolid((float)(UI_X + PAD), (float)lineY, z, (float)(UI_W - 2 * PAD), 1.0f, COLOR_LINE);
63 return lineY + 8;
64}
65
66void ScriptTile::uiHints(const std::string& hints, float z)
67{

Callers

nothing calls this directly

Calls 5

getFunction · 0.85
truncateMethod · 0.80
emptyMethod · 0.45
widthMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected