taisei/src/stagetext.h
Andrei Alexeyev 513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00

68 lines
1.8 KiB
C

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#include "taisei.h"
#include "util.h"
#include "color.h"
#include "resource/font.h"
typedef struct StageText StageText;
typedef void (*StageTextPreDrawFunc)(StageText* txt, int t, float alpha);
typedef struct StageTextTable StageTextTable;
struct StageText {
LIST_INTERFACE(StageText);
char *text;
Font **font;
complex pos;
Alignment align;
float clr[4];
struct {
int spawn;
int life;
int fadein;
int fadeout;
} time;
struct {
StageTextPreDrawFunc predraw;
void *data1;
void *data2;
} custom;
};
void stagetext_free(void);
void stagetext_draw(void);
StageText* stagetext_add(const char *text, complex pos, Alignment align, Font **font, Color clr, int delay, int lifetime, int fadeintime, int fadeouttime);
StageText* stagetext_add_numeric(int n, complex pos, Alignment align, Font **font, Color clr, int delay, int lifetime, int fadeintime, int fadeouttime);
struct StageTextTable {
complex pos;
double width;
Color clr;
int lifetime;
int fadeintime;
int fadeouttime;
int delay;
ListContainer *elems;
};
void stagetext_begin_table(StageTextTable *tbl, const char *title, Color titleclr, Color clr, double width, int delay, int lifetime, int fadeintime, int fadeouttime);
void stagetext_end_table(StageTextTable *tbl);
void stagetext_table_add(StageTextTable *tbl, const char *title, const char *val);
void stagetext_table_add_numeric(StageTextTable *tbl, const char *title, int n);
void stagetext_table_add_numeric_nonzero(StageTextTable *tbl, const char *title, int n);
void stagetext_table_add_separator(StageTextTable *tbl);
void stagetext_table_test(void);