25 const float buttonWidth = 360.0f;
26 const float buttonHeight = 50.0f;
27 const float spacing = 18.0f;
30 const int buttonCount = showMainMenuButton ? 6 : 5;
33 const float totalHeight = (buttonHeight *
static_cast<float>(buttonCount)) +
34 (spacing *
static_cast<float>(buttonCount - 1));
36 auto offsetForIndex = [&](
int idx) {
38 const float start = -(totalHeight / 2.0f) + (buttonHeight / 2.0f);
39 return start + (buttonHeight + spacing) *
static_cast<float>(idx);
43 const float sliderWidth = 300.0f;
44 const float sliderHeight = 20.0f;
45 const float sliderTopMargin = 120.0f;
60 float sliderX, sliderY;
66 LOG_INFO(
"[SettingsMenu] Volume changed: ",
static_cast<int>(value),
"%");
87 0xFF424242, 0xFF616161,
92 0xFF424242, 0xFF616161,
97 0xFF6A1B9A, 0xFF8E24AA, [
this]() {
105 0xFF1976D2, 0xFF1E88E5, [
this]() {
114 if (showMainMenuButton) {
116 0xFF5D4037, 0xFF6D4C41, [
this]() {
140 float sliderX, sliderY;
146 const char *title =
"VOLUME SETTINGS";
147 int titleFontSize = 24;
148 int titleWidth =
static_cast<int>(strlen(title) * titleFontSize * 0.6f);
149 int titleX = (screenWidth - titleWidth) / 2;
150 int titleY =
static_cast<int>(sliderY) - 65;
155 const char *label =
"VOLUME:";
157 int labelWidth =
static_cast<int>(strlen(label) * fontSize * 0.6f);
158 int labelX = (screenWidth - labelWidth) / 2;
159 int labelY =
static_cast<int>(sliderY) - 30;
164 int volumePercent =
static_cast<int>(
_volume);
165 std::string valueText = std::to_string(volumePercent) +
"%";
166 int valueWidth =
static_cast<int>(valueText.length() * fontSize * 0.6f);
167 int valueX = (screenWidth - valueWidth) / 2;
168 int valueY =
static_cast<int>(sliderY) + 30;
virtual void DrawText(int fontHandle, const char *text, int x, int y, int fontSize, unsigned int color)=0
Draw text using a loaded font.