mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2025-01-03 23:43:42 +01:00
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
|
#include "dialogs.h"
|
||
|
|
||
|
#include <gint/keyboard.h>
|
||
|
#include <gint/cpu.h>
|
||
|
|
||
|
#define BOX_HEIGHT (F_HEIGHT/PXSIZE+8)
|
||
|
|
||
|
void showtext(Game *game, bopti_image_t *face, char *text) {
|
||
|
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");
|
||
|
dtext(BOX_HEIGHT*PXSIZE, 8, C_BLACK, "Press any key");
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|