17 #ifndef HEADER_SUPERTUX_OBJECT_LEVEL_TIME_HPP 18 #define HEADER_SUPERTUX_OBJECT_LEVEL_TIME_HPP 20 #include "supertux/game_object.hpp" 21 #include "video/color.hpp" 22 #include "video/surface_ptr.hpp" 34 static Color text_color;
37 static void register_class(ssq::VM& vm);
42 virtual void update(
float dt_sec)
override;
72 static std::string class_name() {
return "leveltime"; }
73 virtual std::string get_class_name()
const override {
return class_name(); }
74 virtual std::string get_exposed_class_name()
const override {
return "LevelTime"; }
75 static std::string display_name() {
return _(
"Time Limit"); }
81 virtual const std::string get_icon_path()
const override {
return "images/engine/editor/clock.png"; }
84 SurfacePtr time_surface;
float get_time() const
Returns the number of seconds left on the clock.
Definition: level_time.cpp:148
A ""LevelTime"" that was given a name can be controlled by scripts.
Definition: level_time.hpp:32
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: level_time.hpp:77
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: level_time.cpp:105
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: level_time.hpp:76
void stop()
Pauses the countdown (assuming it isn't already stopped, in which case it does nothing).
Definition: level_time.cpp:142
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
void set_time(float time_left)
Sets the number of seconds left on the clock.
Definition: level_time.cpp:154
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
void start()
Resumes the countdown (assuming it isn't already started, in which case it does nothing).
Definition: level_time.cpp:136
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: level_time.cpp:61