Files
PixelDefense/game/ui_widgets.c
2023-12-21 19:06:02 +01:00

39 lines
1.0 KiB
C

#include "ui_widgets.h"
void uiPushDivParentPercentage(f32 xPercent, f32 yPercent) {
bzUIPushDiv(UI, (BzUISize) {
.kind = BZ_UI_SIZE_PARENT_PERCENT,
.value = xPercent,
}, (BzUISize) {
.kind = BZ_UI_SIZE_PARENT_PERCENT,
.value = yPercent
});
}
void uiLargeLabel(const char *txt) {
bzUINodeMake(UI, bzUIKeyFromString(txt),
&(BzUINodeDesc) {
.flags = BZ_UI_DRAW_TEXT | BZ_UI_ALIGN_CENTER,
.semanticSize[BZ_UI_AXIS_X] = {
.kind = BZ_UI_SIZE_FIT,
},
.semanticSize[BZ_UI_AXIS_Y] = {
.kind = BZ_UI_SIZE_FIT
},
.string = txt,
.padding = {5, 5, 5, 5},
.style = {
.font = GetFontDefault(),
.fontSize = 62,
.textColor = BLACK,
.textHoverColor = BLACK,
.textActiveColor = BLACK,
}
});
}
bool uiLargeTextButton(const char *txt) {
return bzUIButton(UI, txt, NULL);
}