Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorostanton <oliver@stanton.uk.net>2025-04-05 20:03:28 +0100
committerostanton <oliver@stanton.uk.net>2025-04-05 20:03:28 +0100
commit93d39259cfed341102177f38da58aa249df20789 (patch)
tree9f5540cd06728b23b0c41ac3c6272c411d0be9c0 /src
parent5920354ee9132b87cea62fed2d02fde789c1f8b8 (diff)
downloadldjam57-93d39259cfed341102177f38da58aa249df20789.tar
Thinner sidebar, nice layout
Diffstat (limited to 'src')
-rw-r--r--src/all.c9
-rw-r--r--src/types.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/all.c b/src/all.c
index 028289c..d2536b9 100644
--- a/src/all.c
+++ b/src/all.c
@@ -89,9 +89,14 @@ static const Color colors[N_COLORS][4] = {
},
};
+#define BUTTON_SIZE 32
+#define BUTTON_SPACING 16
+#define BUTTON_SPACER(i) (BUTTON_SPACING + (BUTTON_SIZE * (i) + (i) * BUTTON_SPACING))
+
static const Button buttons[N_BUTTONS] = {
- [BUTTON_RETRY] = {.x = 16, .y = 16, .w = 128, .h = 32},
- [BUTTON_BACK] = {.x = 16, .y = 48, .w = 128, .h = 32},
+ [BUTTON_CONTINUE] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_CONTINUE), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
+ [BUTTON_RETRY] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_RETRY), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
+ [BUTTON_BACK] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_BACK), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
};
static DrawList *render(State *state, UI *ui, Arena *a) {
diff --git a/src/types.c b/src/types.c
index fd8f9ee..8e8ba1d 100644
--- a/src/types.c
+++ b/src/types.c
@@ -7,7 +7,7 @@
#define GRIDWIDTH 20
#define GRIDHEIGHT 16
#define TICK_LENGTH 200
-#define GRID_OFFSET_X 256
+#define GRID_OFFSET_X 64
typedef struct {
unsigned char r, g, b, a;
@@ -47,6 +47,7 @@ enum {
};
enum {
+ BUTTON_CONTINUE,
BUTTON_RETRY,
BUTTON_BACK,
N_BUTTONS,