12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef laytext_H_INCLUDED
- #define laytext_H_INCLUDED
- #include "dynar.h"
- typedef int laytext_callback(char * str, int bytes, void * extra, float * w, float * h);
- Dynar * laytext_layout(char * str, float max_width, laytext_callback * callback, void * extra);
- typedef struct LaytextShard_ LaytextShard;
- typedef struct Laytext_ Laytext;
- struct LaytextShard_ {
- struct LaytextShard_ * next;
- struct LaytextShard_ * previous;
- char * text;
- int bytes;
- float x;
- float y;
- float r;
- float g;
- float b;
- float a;
- void * font;
- };
- typedef int laytext_size_getter(char * str, int bytes, void * font_data, float * w, float * h);
- typedef int laytextshard_drawer(LaytextShard * shard);
- struct Laytext_ {
- LaytextShard * first;
- LaytextShard * last;
- char * text;
- int start_line;
- int end_line;
- int start_pos;
- int end_pos;
- int animation;
- int lines_per_page;
- int page;
- float speed;
- laytext_size_getter * get_size;
- laytextshard_drawer * draw;
- };
- Laytext * laytext_init(Laytext * self, char * text, laytext_size_getter * get_size, laytextshard_drawer * draw);
- Laytext * laytext_update(Laytext * self, char * text);
- void laytext_done(Laytext * self);
- #endif
|