18 #ifndef HEADER_SUPERTUX_OBJECT_TEXTSCROLLER_HPP 19 #define HEADER_SUPERTUX_OBJECT_TEXTSCROLLER_HPP 24 #include "supertux/info_box_line.hpp" 25 #include "supertux/game_object.hpp" 26 #include "control/controller.hpp" 41 virtual void update(
float dt_sec)
override;
43 static std::string class_name() {
return "textscroller"; }
44 virtual std::string get_class_name()
const override {
return class_name(); }
45 static std::string display_name() {
return _(
"Text Scroller"); }
48 virtual const std::string get_icon_path()
const override {
return "images/engine/editor/textscroller.png"; }
50 void set_default_speed(
float default_speed);
51 void scroll(
float offset);
52 bool is_finished()
const {
return m_finished; }
58 void parse_file(
const std::string& filename);
63 std::string m_filename;
64 std::string m_finish_script;
65 std::vector<std::unique_ptr<InfoBoxLine> > m_lines;
67 float m_default_speed;
75 SCROLLER_ANCHOR_CENTER,
80 SCROLLER_ALIGN_CENTER,
85 TextAlign m_text_align;
Definition: controller.hpp:57
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: textscroller.cpp:281
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: textscroller.hpp:46
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: textscroller.hpp:47
Definition: reader_object.hpp:30
Definition: textscroller.hpp:34
Definition: object_settings.hpp:39
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: textscroller.cpp:244
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
Helper class for InfoBox: Represents a line of text.
Definition: info_box_line.hpp:34
virtual GameObjectClasses get_class_types() const
List notable classes in inheritance hierarchy of class.
Definition: game_object.cpp:113
A helper structure to list all the type_indexes of the classes in the type hierarchy of a given class...
Definition: game_object.hpp:57
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
Definition: reader_collection.hpp:30