readouts.h
Display only widgets from the kit, reached through isolenui/kit/kit.h.
#include "isolenui/kit/readouts.h". The guide starts at Readouts.
Readouts
Explained in Readouts.
ui::label_valueui::label_valuefui::badgeui::dotui::progressui::meterui::sparklineui::barsExample
widgets_display.cpp
#include "isolenui/ui/ui.h"
#include "isolenui/kit/kit.h"
// red is the low byte and alpha the high byte, see the styles page
constexpr uint32_t abgr(uint32_t r, uint32_t g, uint32_t b, uint32_t a = 255u)
{
return r | (g << 8) | (b << 16) | (a << 24);
}
static void status_readout(ui::ctx* u, float cpu_load, const float* history,
uint32_t history_count)
{
// label_value, a fixed label beside a fixed string
ui::label_value(u, "backend", "vulkan");
// label_valuef, the same thing with a printf style value
ui::label_valuef(u, "cpu", "%.1f%%", cpu_load);
// badge, a small pill of colored text
ui::badge(u, "beta", abgr(0x8a, 0x64, 0xe5));
// dot, a status light, pulsing when something is live
ui::dot(u, abgr(0x64, 0xc8, 0x6e), true);
// progress, a single fraction between zero and one
ui::progress(u, cpu_load / 100.0f);
// meter, the same fraction drawn as discrete cells
ui::meter(u, cpu_load / 100.0f, 10u);
// sparkline, a thin trace over recent history
ui::sparkline(u, history, history_count, abgr(0x6d, 0x98, 0xcc));
// bars, the same history drawn as a bar chart
ui::bars(u, history, history_count, abgr(0x6d, 0x98, 0xcc));
}