summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorNatrim <maly@kinet.cz>2018-08-17 11:47:29 +0200
committerNatrim <maly@kinet.cz>2018-08-17 12:25:48 +0200
commit6ad0f4ebe8c429eb5e4e8ff52aa0c416574d767e (patch)
treeda116567cd79dda4d71bcdff1b879d49926095b7 /scene/2d
parent985ed5e55abe880025fd3f0cfa484a23d3a0ca32 (diff)
Particles2D: fix editing Visibility Rect from inspector
+ renamed generate_aabb to generate_visibility_rect to prevent future confusions
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/particles_2d.cpp16
-rw-r--r--scene/2d/particles_2d.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index 1da1d44b17..e102b86f53 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -74,14 +74,14 @@ void Particles2D::set_randomness_ratio(float p_ratio) {
randomness_ratio = p_ratio;
VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
-void Particles2D::set_visibility_rect(const Rect2 &p_aabb) {
+void Particles2D::set_visibility_rect(const Rect2 &p_visibility_rect) {
- visibility_rect = p_aabb;
+ visibility_rect = p_visibility_rect;
AABB aabb;
- aabb.position.x = p_aabb.position.x;
- aabb.position.y = p_aabb.position.y;
- aabb.size.x = p_aabb.size.x;
- aabb.size.y = p_aabb.size.y;
+ aabb.position.x = p_visibility_rect.position.x;
+ aabb.position.y = p_visibility_rect.position.y;
+ aabb.size.x = p_visibility_rect.size.x;
+ aabb.size.y = p_visibility_rect.size.y;
VS::get_singleton()->particles_set_custom_aabb(particles, aabb);
@@ -326,7 +326,7 @@ void Particles2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &Particles2D::set_pre_process_time);
ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &Particles2D::set_explosiveness_ratio);
ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &Particles2D::set_randomness_ratio);
- ClassDB::bind_method(D_METHOD("set_visibility_rect", "aabb"), &Particles2D::set_visibility_rect);
+ ClassDB::bind_method(D_METHOD("set_visibility_rect", "visibility_rect"), &Particles2D::set_visibility_rect);
ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &Particles2D::set_use_local_coordinates);
ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &Particles2D::set_fixed_fps);
ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &Particles2D::set_fractional_delta);
@@ -378,7 +378,7 @@ void Particles2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
ADD_GROUP("Drawing", "");
- ADD_PROPERTY(PropertyInfo(Variant::AABB, "visibility_rect"), "set_visibility_rect", "get_visibility_rect");
+ ADD_PROPERTY(PropertyInfo(Variant::RECT2, "visibility_rect"), "set_visibility_rect", "get_visibility_rect");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates");
ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime"), "set_draw_order", "get_draw_order");
ADD_GROUP("Process Material", "process_");
diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h
index f367095581..31a66afb2a 100644
--- a/scene/2d/particles_2d.h
+++ b/scene/2d/particles_2d.h
@@ -84,7 +84,7 @@ public:
void set_pre_process_time(float p_time);
void set_explosiveness_ratio(float p_ratio);
void set_randomness_ratio(float p_ratio);
- void set_visibility_rect(const Rect2 &p_aabb);
+ void set_visibility_rect(const Rect2 &p_visibility_rect);
void set_use_local_coordinates(bool p_enable);
void set_process_material(const Ref<Material> &p_material);
void set_speed_scale(float p_scale);