Testing MeasureString with underlaid box. But it appears to be offset by half-height?
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 4m39s

This commit is contained in:
2024-07-17 15:19:38 -04:00
parent 480502f89e
commit 3a658b1096
2 changed files with 19 additions and 8 deletions

View File

@@ -123,6 +123,9 @@ public:
auto result = Jupiteroid->MeasureString("Jupiteroid Font", 16);
DEBUG(std::format("Result: {},{}", result.x, result.y ));
// TODO: Note the discrepancy in Y between the FillRect and DrawString call here.
J2D::FillRect(JGL::Colors::Gray, {0, 0}, result);
// TODO: Does text render from the middle-point of the glyphs?
J2D::DrawString(JGL::Colors::Green, "Jupteroid Font", 0.f, 16, 1.f, 16, *Jupiteroid);
J2D::DrawString(JGL::Colors::White, "Position: " + std::to_string(camera->position.x) + " " + std::to_string(camera->position.y) + " " + std::to_string(camera->position.z), 0, 33, 1,16, *Jupiteroid);
J2D::DrawString(JGL::Colors::White, "ViewAngle: " + std::to_string(camera->angle.x) + " " + std::to_string(camera->angle.y) + " " + std::to_string(camera->angle.z), 0, 50, 1,16, *Jupiteroid);