Definition at line 19 of file SubTitleAgent.h.
Public Types | |
typedef std::deque< Title * > | t_titles |
Public Member Functions | |
int | getLimitY () const |
void | setLimitY (int limitY) |
void | addFont (const std::string &fontname, Color *new_color) |
void | newSubtitle (const std::string &subtitle, const std::string &fontname) |
Create new subtitle. | |
void | killTalks () |
Kill all running subtitles. | |
void | removeAll () |
Kill all subtitles and remove fonts. | |
virtual void | drawOn (SDL_Surface *screen) |
Draw all subtitles. | |
Data Fields | |
t_titles | m_titles |
Font * | m_font |
ResColorPack * | m_colors |
int | m_limitY |
Static Public Attributes | |
static const int | TITLE_ROW = 26 |
static const int | TITLE_BASE = 20 |
static const int | TITLE_SPEED = 2 |
static const int | TITLE_BORDER = 20 |
static const int | TITLE_LIMIT_Y = TITLE_BASE + 5 * TITLE_ROW |
Protected Member Functions | |
virtual void | own_init () |
virtual void | own_update () |
Shift all titles up. | |
virtual void | own_shutdown () |
|
Definition at line 27 of file SubTitleAgent.h. |
|
Definition at line 59 of file SubTitleAgent.cpp.
|
|
Draw all subtitles.
Implements Drawable. Definition at line 223 of file SubTitleAgent.cpp. 00224 { 00225 if (OptionAgent::agent()->getAsBool("subtitles", true)) { 00226 t_titles::iterator end = m_titles.end(); 00227 for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { 00228 (*i)->drawOn(screen); 00229 } 00230 } 00231 }
|
|
Definition at line 46 of file SubTitleAgent.h. 00046 { return m_limitY; }
|
|
Kill all running subtitles.
Definition at line 199 of file SubTitleAgent.cpp. 00200 { 00201 t_titles::iterator end = m_titles.end(); 00202 for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { 00203 delete *i; 00204 } 00205 m_titles.clear(); 00206 }
|
|
Create new subtitle. Shift all existing subtitles up. Definition at line 69 of file SubTitleAgent.cpp. 00071 { 00072 const Color *color = m_colors->getRes(fontname); 00073 00074 std::string subtitle = original; 00075 while (!subtitle.empty()) { 00076 subtitle = splitAndCreate(subtitle, color); 00077 } 00078 }
|
|
Reimplemented from BaseAgent. Definition at line 21 of file SubTitleAgent.cpp. 00022 { 00023 m_limitY = TITLE_LIMIT_Y; 00024 m_colors = new ResColorPack(); 00025 00026 m_font = NULL; 00027 m_font = new Font(Path::dataReadPath("font/font_subtitle.ttf"), 20); 00028 }
|
|
Reimplemented from BaseAgent. Definition at line 48 of file SubTitleAgent.cpp. 00049 { 00050 removeAll(); 00051 delete m_colors; 00052 if (m_font) { 00053 delete m_font; 00054 } 00055 }
|
|
Shift all titles up. Try remove the oldest subtitle. Reimplemented from BaseAgent. Definition at line 35 of file SubTitleAgent.cpp. 00036 { 00037 if (!m_titles.empty()) { 00038 shiftTitlesUp(TITLE_SPEED); 00039 00040 if (m_titles.front()->isGone()) { 00041 delete m_titles.front(); 00042 m_titles.pop_front(); 00043 } 00044 } 00045 }
|
|
Kill all subtitles and remove fonts.
Definition at line 212 of file SubTitleAgent.cpp.
|
|
Definition at line 47 of file SubTitleAgent.h. 00047 { m_limitY = limitY; }
|
|
Definition at line 31 of file SubTitleAgent.h. |
|
Definition at line 30 of file SubTitleAgent.h. |
|
Definition at line 32 of file SubTitleAgent.h. |
|
Definition at line 28 of file SubTitleAgent.h. |
|
Definition at line 23 of file SubTitleAgent.h. |
|
Definition at line 25 of file SubTitleAgent.h. |
|
Definition at line 26 of file SubTitleAgent.h. |
|
Definition at line 22 of file SubTitleAgent.h. |
|
Definition at line 24 of file SubTitleAgent.h. |