taisei/src/dialog.h

49 lines
925 B
C
Raw Normal View History

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
2018-01-04 18:14:31 +01:00
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
2017-09-27 14:14:53 +02:00
#pragma once
#include "taisei.h"
#include <stdbool.h>
#include "resource/texture.h"
struct DialogMessage;
struct DialogSpeaker;
typedef enum {
Right,
2017-01-24 14:40:57 +01:00
Left,
BGM
} Side;
typedef struct DialogMessage {
Side side;
char *msg;
2017-11-12 18:16:15 +01:00
int timeout;
} DialogMessage;
typedef struct Dialog {
DialogMessage *messages;
Texture *images[2];
int count;
int pos;
int page_time;
int birthtime;
} Dialog;
Dialog *create_dialog(const char *left, const char *right);
void dset_image(Dialog *d, Side side, const char *name);
2017-11-12 18:16:15 +01:00
DialogMessage* dadd_msg(Dialog *d, Side side, const char *msg);
void delete_dialog(Dialog *d);
void draw_dialog(Dialog *dialog);
2017-11-12 18:16:15 +01:00
bool page_dialog(Dialog **d);