17 #ifndef HEADER_SUPERTUX_OBJECT_RAIN_PARTICLE_SYSTEM_HPP 18 #define HEADER_SUPERTUX_OBJECT_RAIN_PARTICLE_SYSTEM_HPP 20 #include "object/particlesystem_interactive.hpp" 22 #include "math/easing.hpp" 23 #include "video/surface_ptr.hpp" 34 static void register_class(ssq::VM& vm);
44 virtual void update(
float dt_sec)
override;
46 static std::string class_name() {
return "particles-rain"; }
47 virtual std::string get_class_name()
const override {
return class_name(); }
48 virtual std::string get_exposed_class_name()
const override {
return "RainParticleSystem"; }
49 static std::string display_name() {
return _(
"Rain Particles"); }
75 void fade_angle(
float angle,
float time,
const std::string& ease);
78 void fade_angle(
float new_angle,
float fade_time, easing ease_func);
80 virtual const std::string get_icon_path()
const override {
81 return "images/engine/editor/rain.png";
85 static float constexpr
const max_amount = 5.0f;
86 static float constexpr
const min_amount = 0.1f;
89 static float constexpr
const fog_start_amount = 1.0f;
92 static float constexpr
const fog_max_value = 0.6f;
95 void set_amount(
float amount);
96 void set_angle(
float angle);
109 SurfacePtr rainimages[2];
111 float m_current_speed;
112 float m_target_speed;
113 float m_speed_fade_time_remaining;
116 float m_current_angle;
117 float m_target_angle;
118 float m_angle_fade_time_remaining;
119 float m_angle_fade_time_total;
120 easing m_angle_easing;
122 float m_current_amount;
123 float m_target_amount;
124 float m_amount_fade_time_remaining;
126 float m_current_real_amount;
void fade_amount(float amount, float time)
Smoothly changes the amount of particles to the given value in ""time"" seconds.
Definition: rain_particle_system.cpp:252
This is an alternative class for particle systems.
Definition: particlesystem_interactive.hpp:39
void fade_angle(float angle, float time, const std::string &ease)
Smoothly changes the angle of the rain the given value in ""time"" seconds, according to the provided...
Definition: rain_particle_system.cpp:267
Definition: particlesystem.hpp:86
Definition: object_settings.hpp:39
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: particlesystem_interactive.hpp:50
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: rain_particle_system.cpp:289
A ""RainParticleSystem"" that was given a name can be controlled by scripts.
Definition: rain_particle_system.hpp:31
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: rain_particle_system.cpp:144
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: rain_particle_system.hpp:51
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: rain_particle_system.hpp:50
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
void fade_speed(float speed, float time)
Smoothly changes the rain speed to the given value in ""time"" seconds.
Definition: rain_particle_system.cpp:238