17 #ifndef HEADER_SUPERTUX_OBJECT_TEXT_ARRAY_OBJECT_HPP 18 #define HEADER_SUPERTUX_OBJECT_TEXT_ARRAY_OBJECT_HPP 22 #include "squirrel/exposed_object.hpp" 23 #include "scripting/text_array.hpp" 25 #include "supertux/game_object.hpp" 26 #include "supertux/timer.hpp" 28 #include "object/text_object.hpp" 29 #include "object/text_array_item.hpp" 31 typedef size_t ta_index;
44 virtual void update(
float dt_sec)
override;
49 virtual std::string get_class()
const override {
return "text-array"; }
50 virtual std::string get_display_name()
const override {
return _(
"Text array"); }
52 virtual const std::string get_icon_path()
const override {
53 return "images/engine/editor/textarray.png";
64 void add_text(
const std::string& text,
float duration = 3.0f);
123 void override_properties();
126 void reset_automation();
130 void handle_input_requests();
141 bool m_fadeTransition;
145 std::vector<std::unique_ptr<TextArrayItem> > m_texts;
146 ta_index m_curTextIndex;
147 ta_index m_lastTextIndex;
virtual bool is_singleton() const override
If true only a single object of this type is allowed in a given GameObjectManager.
Definition: text_array_object.hpp:46
void set_auto(bool is_auto)
Sets the auto flag on & starts the auto narration.
Definition: text_array_object.cpp:155
TextArrayItem * get_current_text_item()
Gets the current text item.
Definition: text_array_object.cpp:137
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: text_array_object.cpp:194
A text array object intended for narration.
Definition: text_array_object.hpp:34
This class binds a certain GameObject class to a scripting class.
Definition: exposed_object.hpp:45
void add_text(const std::string &text, float duration=3.0f)
Adds a text with duration.
Definition: text_array_object.cpp:58
void set_fade_time(float fadetime)
Sets fadetime for fade_transition.
Definition: text_array_object.cpp:76
void set_text_index(ta_index index)
Sets the current text index.
Definition: text_array_object.cpp:69
void clear()
Empties the text array.
Definition: text_array_object.cpp:51
TextArrayItem * get_last_text_item()
Gets the last text item.
Definition: text_array_object.cpp:143
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
void next_text()
Sets the current text to the next one.
Definition: text_array_object.cpp:82
void set_done(bool done)
Sets the done flag as on.
Definition: text_array_object.cpp:149
Definition: text_array_item.hpp:17
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: text_array_object.cpp:162
void set_keep_visible(bool keep_visible)
Sets the keep visible flag.
Definition: text_array_object.cpp:114
void prev_text()
Sets the current text to the previous.
Definition: text_array_object.cpp:99
TextArrayItem * get_text_item(ta_index index)
Gets the text item at a certain index.
Definition: text_array_object.cpp:126
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
void set_fade_transition(bool fade_transition)
Sets the fade transition flag.
Definition: text_array_object.cpp:120
Definition: reader_mapping.hpp:31
virtual bool is_saveable() const override
Indicates if the object will be saved.
Definition: text_array_object.hpp:47
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42