2023-07-09 22:02:59 +02:00
|
|
|
#include "dialogs.h"
|
|
|
|
|
|
|
|
#include <gint/keyboard.h>
|
|
|
|
#include <gint/cpu.h>
|
|
|
|
|
|
|
|
#define BOX_HEIGHT (F_HEIGHT/PXSIZE+8)
|
|
|
|
|
2023-07-10 20:55:27 +02:00
|
|
|
extern font_t fontRPG;
|
|
|
|
|
2023-07-09 22:02:59 +02:00
|
|
|
void showtext(Game *game, bopti_image_t *face, char *text) {
|
2023-07-10 20:55:27 +02:00
|
|
|
dfont(&fontRPG);
|
2023-07-09 22:02:59 +02:00
|
|
|
unsigned int i;
|
|
|
|
for(i=0;i<BOX_HEIGHT;i++){
|
|
|
|
draw(game);
|
|
|
|
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
|
|
|
|
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
|
|
|
|
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
|
|
|
|
DIMAGE_NONE);
|
|
|
|
dupdate();
|
|
|
|
while(game->frame_duration < 20) sleep();
|
|
|
|
game->frame_duration = 0;
|
|
|
|
}
|
|
|
|
/* We should start to drawint the text on the x axis at BOX_HEIGHT to avoid
|
|
|
|
* drawing on the face. */
|
|
|
|
/* Show a little message that showing text in dialogs is not implemented
|
|
|
|
* yet. */
|
|
|
|
dtext(BOX_HEIGHT*PXSIZE, 1, C_BLACK, "Dialogs not implemented");
|
2023-07-10 20:55:27 +02:00
|
|
|
dtext(BOX_HEIGHT*PXSIZE, 8*PXSIZE, C_BLACK, "Press any key");
|
2023-07-09 22:02:59 +02:00
|
|
|
dupdate();
|
|
|
|
getkey();
|
|
|
|
for(i=0;i<strlen(text);i++){
|
|
|
|
/**/
|
|
|
|
}
|
|
|
|
for(i=40;i>0;i--){
|
|
|
|
draw(game);
|
|
|
|
drect(0, 0, DWIDTH, i*PXSIZE, C_WHITE);
|
|
|
|
drect(0, i*PXSIZE, DWIDTH, (i+1)*PXSIZE, C_BLACK);
|
|
|
|
dsubimage(4*PXSIZE, 2*PXSIZE, face, 0, 0, F_WIDTH, (i-8)*PXSIZE,
|
|
|
|
DIMAGE_NONE);
|
|
|
|
dupdate();
|
|
|
|
while(game->frame_duration < 20) sleep();
|
|
|
|
game->frame_duration = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|