Made UI options small and split the text field.

This commit is contained in:
Kapendev 2025-01-01 10:11:18 +02:00
parent c1377e301d
commit 1c23914aba
6 changed files with 52 additions and 65 deletions

View file

@ -15,7 +15,7 @@ bool myButton(IStr text) {
} else {
drawTextureArea(atlas, Rect(uiItemSize), uiItemPoint, DrawOptions(gray1));
}
drawUiText(uiItemSize, text, uiItemPoint, UiButtonOptions(Alignment.left, 6));
drawUiText(uiItemSize, text, uiItemPoint, UiOptions(Alignment.left, 6));
return result;
}

View file

@ -3,7 +3,7 @@
import parin;
auto handlePosition = Vec2(120, 60);
auto handleOptions = UiButtonOptions();
auto handleOptions = UiOptions();
void ready() {
lockResolution(320, 180);

View file

@ -17,11 +17,11 @@ bool update(float dt) {
setUiStartPoint(Vec2(8));
// Create a horizontal layout for arranging subsequent UI items.
useUiLayout(Layout.h);
uiText(textSize, "Cool Button", UiButtonOptions(Alignment.left));
uiText(textSize, "Cool Button", UiOptions(Alignment.left));
if (uiButton(buttonSize, "")) println("Cool");
// Create a new horizontal layout under the previous layout.
useUiLayout(Layout.h);
uiText(textSize, "Super Button", UiButtonOptions(Alignment.left));
uiText(textSize, "Super Button", UiOptions(Alignment.left));
if (uiButton(buttonSize, "")) println("Super");
return false;
}