| 167 | } |
| 168 | |
| 169 | float TextPool::draw(const std::string& s, float x, float y, float scale, u32 color, float depth) |
| 170 | { |
| 171 | const C2D_Text* t = obtain(s, nullptr); |
| 172 | // Snap the pen to whole pixels: the system font is a bitmap atlas, so |
| 173 | // fractional origins smear glyph edges across two texels and read as blurry. |
| 174 | C2D_DrawText(t, C2D_WithColor, floorf(x + 0.5f), floorf(y + 0.5f), depth, scale, scale, color); |
| 175 | return StringUtils::textWidth(*t, scale); |
| 176 | } |
| 177 | |
| 178 | void TextPool::drawCentered(const std::string& s, float x, float w, float y, float scale, u32 color, float depth) |
| 179 | { |
no outgoing calls
no test coverage detected