17 #ifndef HEADER_SUPERTUX_OBJECT_BACKGROUND_HPP 18 #define HEADER_SUPERTUX_OBJECT_BACKGROUND_HPP 20 #include "math/vector.hpp" 21 #include "scripting/background.hpp" 22 #include "squirrel/exposed_object.hpp" 23 #include "supertux/game_object.hpp" 24 #include "video/blend.hpp" 25 #include "video/drawing_context.hpp" 26 #include "video/surface_ptr.hpp" 38 virtual void update(
float dt_sec)
override;
41 virtual std::string get_class()
const override {
return "background"; }
42 virtual std::string get_display_name()
const override {
return _(
"Background"); }
44 virtual const std::string get_icon_path()
const override {
45 return "images/engine/editor/background.png";
49 virtual void after_editor_set()
override;
51 void set_image(
const std::string& name);
52 void set_images(
const std::string& name_top,
const std::string& name_middle,
const std::string& name_bottom);
53 void set_speed(
float bgd_speed);
57 std::string get_image()
const {
return m_imagefile; }
58 float get_speed()
const {
return m_parallax_speed.x; }
59 int get_layer()
const {
return m_layer; }
74 Alignment m_alignment;
82 std::string m_imagefile_top;
83 std::string m_imagefile;
84 std::string m_imagefile_bottom;
89 SurfacePtr m_image_top;
91 SurfacePtr m_image_bottom;
97 DrawingTarget m_target;
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: background.cpp:329
Simple two dimensional vector.
Definition: vector.hpp:24
This class binds a certain GameObject class to a scripting class.
Definition: exposed_object.hpp:45
Definition: background.hpp:30
Definition: object_settings.hpp:35
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: background.cpp:198
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
Definition: reader_mapping.hpp:31
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42