forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathsimticker.h
65 lines (50 loc) · 1.14 KB
/
simticker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* This file is part of the Simutrans-Extended project under the Artistic License.
* (see LICENSE.txt)
*/
#ifndef SIMTICKER_H
#define SIMTICKER_H
#include "simcolor.h"
#include "display/simgraph.h"
#define TICKER_V_SPACE (2) // Vertical offset of ticker text
#define TICKER_HEIGHT (LINESPACE+2*TICKER_V_SPACE)
class koord;
/**
* A very simple scrolling news ticker.
*/
namespace ticker
{
bool empty();
/**
* Add a message to the message list
* @param pos position of the event
* @param color message color
*/
void add_msg(const char*, koord pos, FLAGGED_PIXVAL color);
/**
* Remove all messages and mark for redraw
*/
void clear_messages();
/**
* @returns the 2D world position of the most recent visible message
*/
koord get_welt_pos();
/**
* Update message positions and remove old messages
*/
void update();
/**
* Redraw the ticker partially or fully (if set_redraw_all() was called)
*/
void draw();
/**
* Set true if ticker has to be redrawn fully
* @sa redraw
*/
void set_redraw_all(bool redraw);
/**
* Force a ticker redraw (e.g. after a window resize)
*/
void redraw();
};
#endif