Tweak FPS Display a little

This commit is contained in:
Agent X 2023-11-23 10:50:06 -05:00
parent 13c0e693f8
commit 0a39303a5a

View file

@ -11,7 +11,7 @@ struct DjuiFpsDisplay *sFpsDisplay = NULL;
void djui_fps_display_update(s16 fps) { void djui_fps_display_update(s16 fps) {
if (configShowFPS) { if (configShowFPS) {
char fpsText[30] = ""; char fpsText[30] = "";
snprintf(fpsText, 30, "\\#dcdcdc\\FPS \\#ffffff\\%d", fps); snprintf(fpsText, 30, "\\#dcdcdc\\FPS: \\#ffffff\\%d", fps);
djui_text_set_text(sFpsDisplay->text, fpsText); djui_text_set_text(sFpsDisplay->text, fpsText);
} }
} }
@ -30,15 +30,16 @@ void djui_fps_display_create(void) {
djui_base_set_size(base, 150, 50); djui_base_set_size(base, 150, 50);
djui_base_set_color(base, 0, 0, 0, 240); djui_base_set_color(base, 0, 0, 0, 240);
djui_base_set_border_color(base, 0, 0, 0, 200); djui_base_set_border_color(base, 0, 0, 0, 200);
djui_base_set_border_width(base, 8); djui_base_set_border_width(base, 4);
djui_base_set_padding(base, 16, 16, 16, 16); djui_base_set_padding(base, 16, 16, 16, 16);
{ {
// FPS text // FPS text
struct DjuiText *text = djui_text_create(base, ""); struct DjuiText *text = djui_text_create(base, "");
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);
djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&text->base, 1.0f, text->fontScale * 2); djui_base_set_size(&text->base, 1.0f, text->fontScale * 2);
djui_base_set_location(&text->base, 0, -text->fontScale / 2); djui_base_set_location(&text->base, 0, -text->fontScale / 3.0f);
fpsDisplay->text = text; fpsDisplay->text = text;
} }