17 #ifndef HEADER_SUPERTUX_OBJECT_FLOATING_IMAGE_HPP 18 #define HEADER_SUPERTUX_OBJECT_FLOATING_IMAGE_HPP 20 #include "math/anchor_point.hpp" 21 #include "sprite/sprite_ptr.hpp" 22 #include "supertux/game_object.hpp" 35 static void register_class(ssq::VM& vm);
43 virtual std::string get_exposed_class_name()
const override {
return "FloatingImage"; }
45 virtual void update(
float dt_sec)
override;
78 #ifdef DOXYGEN_SCRIPTING 84 float get_pos_x()
const;
90 float get_pos_y()
const;
154 AnchorPoint m_anchor;
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: floating_image.cpp:43
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: floating_image.cpp:146
void set_pos(float x, float y)
Sets the location of the image in relation to the current anchor point.
Definition: floating_image.cpp:78
virtual bool is_saveable() const override
Indicates if the object will be saved.
Definition: floating_image.hpp:41
float get_y() const
Returns the image's Y coordinate relative to the current anchor point.
Definition: floating_image.cpp:90
void set_layer(int layer)
Definition: floating_image.cpp:66
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: floating_image.hpp:42
void set_anchor_point(int anchor)
Sets the image's anchor point.
Definition: floating_image.cpp:96
void fade_out(float time)
Fades out the image for the next ""time"" seconds.
Definition: floating_image.cpp:139
This class provides the ability to create, edit, and remove images floating in midair on the screen...
Definition: floating_image.hpp:32
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
bool get_visible() const
Definition: floating_image.cpp:108
void fade_in(float time)
Fades in the image for the next ""time"" seconds.
Definition: floating_image.cpp:132
void set_action(const std::string &action)
Sets the action of the image.
Definition: floating_image.cpp:120
virtual GameObjectClasses get_class_types() const
List notable classes in inheritance hierarchy of class.
Definition: game_object.cpp:113
int get_layer() const
Definition: floating_image.cpp:72
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
int get_anchor_point() const
Returns the current anchor point.
Definition: floating_image.cpp:102
float get_x() const
Returns the image's X coordinate relative to the current anchor point.
Definition: floating_image.cpp:84
std::string get_action() const
Returns the name of the action of the image, as defined in the sprite.
Definition: floating_image.cpp:126
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
void set_visible(bool visible)
Definition: floating_image.cpp:114