formatting: cleaned up formatting of this change, added TODO

This commit is contained in:
A.M. Rowsell 2026-04-04 00:23:24 -04:00
commit 39b7e01119
Signed by: amr
GPG key ID: E0879EDBDB0CA7B1

View file

@ -286,11 +286,14 @@ void render_game_over(void) {
void render_message(const char *message) {
if (message == NULL)
return;
int msg_len = strlen(message);
float msg_ratio = 13.5;
// Draw message box
// Rectangle msg_bg = {(float)(SCREEN_WIDTH / 2.0f - 150.0f), (float)(SCREEN_HEIGHT / 2.0f - 30.0f), 300, 60};
// TODO: Separate out the calculation of the x/y and width/height so that if a message takes up more than, say,
// 75% of the screen width, we add a line break and increase the height. That would then require calculating the
// width based on the longest line.
Rectangle msg_bg = {(float)(SCREEN_WIDTH / 2.0f - ((msg_ratio / 2.03f) * msg_len)),
(float)(SCREEN_HEIGHT / 2.0f - 30.0f), msg_ratio * msg_len, 60};
DrawRectangleRec(msg_bg, (Color){45, 45, 45, 235});