17 #ifndef HEADER_SUPERTUX_OBJECT_DECAL_HPP 18 #define HEADER_SUPERTUX_OBJECT_DECAL_HPP 20 #include "object/moving_sprite.hpp" 21 #include "supertux/timer.hpp" 38 static void register_class(ssq::VM& vm);
46 static std::string class_name() {
return "decal"; }
47 virtual std::string get_class_name()
const override {
return class_name(); }
48 virtual std::string get_exposed_class_name()
const override {
return "Decal"; }
49 static std::string display_name() {
return _(
"Decal"); }
56 virtual void update(
float dt_sec)
override;
58 virtual void on_flip(
float height)
override;
66 void fade_sprite(
const std::string& sprite,
float time);
67 #ifdef DOXYGEN_SCRIPTING 74 void change_sprite(
const std::string& sprite);
89 void set_visible(
bool v) { m_visible = v; }
90 bool is_visible()
const {
return m_visible; }
93 std::string m_default_action;
95 SpritePtr m_fade_sprite;
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: decal.cpp:107
virtual HitResponse collision(GameObject &, const CollisionHit &) override
this function is called when the object collided with any other object
Definition: decal.hpp:44
A decorative image, perhaps part of the terrain.
Definition: decal.hpp:33
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: decal.hpp:50
void fade_in(float time)
Fades in the decal in ""time"" seconds.
Definition: decal.cpp:72
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: decal.hpp:51
void fade_sprite(const std::string &sprite, float time)
Fades the decal sprite to a new one in ""time"" seconds.
Definition: decal.cpp:90
Definition: object_settings.hpp:39
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_sprite.hpp:60
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: decal.cpp:63
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
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
void fade_out(float time)
Fades out the decal in ""time"" seconds.
Definition: decal.cpp:81
Definition: reader_mapping.hpp:32
Abstract base class for ""MovingObject""s, that are represented by a sprite.
Definition: moving_sprite.hpp:33
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44
virtual void on_flip(float height) override
When level is flipped vertically.
Definition: decal.cpp:100