finished renaming things
This commit is contained in:
@@ -28,15 +28,15 @@ i32 main(i32 argc, char** argv) {
|
||||
tim_frame(0, 0, ~0, ~0, CFR);
|
||||
|
||||
// draw message
|
||||
label(argv[1], A, 1, msg.width, msg.lines, CTXT);
|
||||
tim_label(argv[1], A, 1, msg.width, msg.lines, CTXT);
|
||||
|
||||
// draw 'yes' button, return 0 when clicked
|
||||
if (button("[y] Yes", 2, ~1, A, A, CYES) || tim_is_key_press('y')) {
|
||||
if (tim_button("[y] Yes", 2, ~1, A, A, CYES) || tim_is_key_press('y')) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// draw 'no' button, return 1 when clicked
|
||||
if (button("[n] No", ~2, ~1, A, A, CNO) || tim_is_key_press('n')) {
|
||||
if (tim_button("[n] No", ~2, ~1, A, A, CNO) || tim_is_key_press('n')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ i32 main(void) {
|
||||
tim_scope(A, A, 24, 8) { // centered 24x8 scope
|
||||
u64 c = 0x0a060f; // three colors
|
||||
tim_frame(0, 0, ~0, ~0, c); // draw frame for scope
|
||||
label("Greetings!", A, 2, A, A, c); // label in top center
|
||||
if (button("OK", A, ~1, 8, A, c)) // button in bottom center
|
||||
tim_label("Greetings!", A, 2, A, A, c); // label in top center
|
||||
if (tim_button("OK", A, ~1, 8, A, c)) // button in bottom center
|
||||
return 0; // exit on button click
|
||||
if (tim_is_key_press('q')) // ctrl-c is masked
|
||||
return 0; // exit on 'q' press
|
||||
|
||||
@@ -102,14 +102,14 @@ static void menu(void) {
|
||||
tim_scope(A, A, 20, 13) {
|
||||
char* lbl = snek.state == OVER ? "GAME OVER" : "SNEK - THE GAME";
|
||||
char* btn = snek.state == PAUSE ? "Resume" : "Play";
|
||||
label(lbl, A, 0, A, A, BTN);
|
||||
if (button(btn, A, 2, 20, 5, BTN) || tim_is_key_press(TimKey_Enter)) {
|
||||
tim_label(lbl, A, 0, A, A, BTN);
|
||||
if (tim_button(btn, A, 2, 20, 5, BTN) || tim_is_key_press(TimKey_Enter)) {
|
||||
if (snek.state != PAUSE) {
|
||||
start();
|
||||
}
|
||||
snek.state = RUN;
|
||||
}
|
||||
if (button("Exit", A, 8, 20, 5, BTN) || tim_is_key_press('q') || tim_is_key_press(TimKey_Escape)) {
|
||||
if (tim_button("Exit", A, 8, 20, 5, BTN) || tim_is_key_press('q') || tim_is_key_press(TimKey_Escape)) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user