bar styling, state color

This commit is contained in:
Luka Jankovic 2025-06-24 23:26:14 +02:00
parent 10d243055d
commit b2a5ede334
4 changed files with 14 additions and 3 deletions

View file

@ -19,7 +19,8 @@
#include "kubo_bar.h"
static inline int push_text(int x, int y, const char *text) {
DrawText(text, x, y, KUBO_BAR_HEIGHT, WHITE);
DrawText(text, x, y + (KUBO_BAR_PADDING / 2),
KUBO_BAR_HEIGHT - KUBO_BAR_PADDING, WHITE);
return x + MeasureText(text, KUBO_BAR_HEIGHT);
}
@ -28,6 +29,8 @@ void kubo_bar_render(struct kubo_context *context) {
const int bar_y = GetScreenHeight() - KUBO_BAR_HEIGHT;
int bar_text_x = 10;
DrawRectangle(0, bar_y, GetScreenWidth(), KUBO_BAR_HEIGHT, BLACK);
bar_text_x = push_text(bar_text_x, bar_y, kubo_context_get_label(context->state));
DrawRectangle(0, bar_y, GetScreenWidth(), KUBO_BAR_HEIGHT,
kubo_context_get_color(context->state));
bar_text_x =
push_text(bar_text_x, bar_y, kubo_context_get_label(context->state));
}