Compare commits

...

2 Commits

Author SHA1 Message Date
Lephenixnoir 403e2c32d5
tutorial-01: add images 2020-07-25 12:19:15 +02:00
Lephenixnoir df6536a6e7
make the main menu interactive 2020-07-25 12:16:15 +02:00
11 changed files with 28 additions and 7 deletions

Binary file not shown.

View File

@ -1,13 +1,10 @@
#include <gint/display.h>
#include <gint/keyboard.h>
int main(void)
static void draw_menu(int selected)
{
extern bopti_image_t img_title;
extern bopti_image_t img_levels;
extern font_t font_mystere;
dfont(&font_mystere);
dclear(C_WHITE);
dimage(0, 2, &img_title);
@ -26,10 +23,34 @@ int main(void)
{
dsubimage(x, y, &img_levels, 11,0,10,10, DIMAGE_NONE);
}
if(i == selected)
{
drect(x+1, y+1, x+8, y+8, C_INVERT);
}
}
}
int main(void)
{
extern font_t font_mystere;
dfont(&font_mystere);
int selected = 1;
int key = 0;
while(key != KEY_EXE)
{
draw_menu(selected);
dupdate();
key = getkey().key;
if(key == KEY_LEFT && selected > 1)
selected--;
if(key == KEY_RIGHT && selected < 8)
selected++;
}
dupdate();
getkey();
return 1;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B