summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/camera_2d.cpp6
-rw-r--r--scene/2d/canvas_item.h2
-rw-r--r--scene/2d/joints_2d.h2
-rw-r--r--scene/2d/light_2d.cpp2
-rw-r--r--scene/2d/navigation2d.cpp3
-rw-r--r--scene/2d/node_2d.h2
-rw-r--r--scene/2d/parallax_background.h2
-rw-r--r--scene/2d/parallax_layer.h4
-rw-r--r--scene/2d/particles_2d.cpp2
-rw-r--r--scene/2d/particles_2d.h2
-rw-r--r--scene/2d/path_2d.h2
-rw-r--r--scene/2d/physics_body_2d.cpp3
-rw-r--r--scene/2d/polygon_2d.h4
-rw-r--r--scene/2d/screen_button.h2
-rw-r--r--scene/2d/tile_map.cpp8
15 files changed, 25 insertions, 21 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index b11c1dd642..20571abdb9 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -552,11 +552,11 @@ float Camera2D::get_h_offset() const {
return h_ofs;
}
-void Camera2D::_set_old_smoothing(float p_val) {
+void Camera2D::_set_old_smoothing(float p_enable) {
//compatibility
- if (p_val > 0) {
+ if (p_enable > 0) {
smoothing_enabled = true;
- set_follow_smoothing(p_val);
+ set_follow_smoothing(p_enable);
}
}
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 27842727ac..660ddcf930 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -297,7 +297,7 @@ public:
void set_use_parent_material(bool p_use_parent_material);
bool get_use_parent_material() const;
- Ref<InputEvent> make_input_local(const Ref<InputEvent> &pevent) const;
+ Ref<InputEvent> make_input_local(const Ref<InputEvent> &p_event) const;
Vector2 make_canvas_pos_local(const Vector2 &screen_point) const;
Vector2 get_global_mouse_position() const;
diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h
index b52b0f4670..f854ce51ee 100644
--- a/scene/2d/joints_2d.h
+++ b/scene/2d/joints_2d.h
@@ -81,7 +81,7 @@ protected:
static void _bind_methods();
public:
- void set_softness(real_t p_stiffness);
+ void set_softness(real_t p_softness);
real_t get_softness() const;
PinJoint2D();
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index e8c2122bd1..ffe69fa93f 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -416,7 +416,7 @@ void Light2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_texture_offset", "get_texture_offset");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0.01,100,0.01"), "set_energy", "get_energy");
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Add,Sub,Mix,Mask"), "set_mode", "get_mode");
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index e579838903..383236b4ca 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -646,7 +646,8 @@ debug path
break;
}
- path.push_back(begin_point);
+ if (path[path.size() - 1].distance_to(begin_point) > CMP_EPSILON)
+ path.push_back(begin_point);
path.invert();
}
diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h
index df9a05ff79..a6009851c7 100644
--- a/scene/2d/node_2d.h
+++ b/scene/2d/node_2d.h
@@ -49,7 +49,7 @@ class Node2D : public CanvasItem {
void _update_transform();
// Deprecated, should be removed in a future version.
- void _set_rotd(float p_angle);
+ void _set_rotd(float p_degrees);
float _get_rotd() const;
void _update_xform_values();
diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h
index 99d8dd3811..fce1bbd928 100644
--- a/scene/2d/parallax_background.h
+++ b/scene/2d/parallax_background.h
@@ -60,7 +60,7 @@ public:
void set_scroll_offset(const Point2 &p_ofs);
Point2 get_scroll_offset() const;
- void set_scroll_scale(float p_ofs);
+ void set_scroll_scale(float p_scale);
float get_scroll_scale() const;
void set_scroll_base_offset(const Point2 &p_ofs);
diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h
index 85e70b0a51..f2d0053342 100644
--- a/scene/2d/parallax_layer.h
+++ b/scene/2d/parallax_layer.h
@@ -48,7 +48,7 @@ protected:
static void _bind_methods();
public:
- void set_motion_offset(const Size2 &p_scale);
+ void set_motion_offset(const Size2 &p_offset);
Size2 get_motion_offset() const;
void set_motion_scale(const Size2 &p_scale);
@@ -57,7 +57,7 @@ public:
void set_mirroring(const Size2 &p_mirroring);
Size2 get_mirroring() const;
- void set_base_offset_and_scale(const Point2 &p_offsetf, float p_scale);
+ void set_base_offset_and_scale(const Point2 &p_offset, float p_scale);
virtual String get_configuration_warning() const;
ParallaxLayer();
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index 4aa841131a..a2ec33f403 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -55,6 +55,8 @@ void Particles2D::set_one_shot(bool p_enable) {
one_shot = p_enable;
VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ if (!one_shot && emitting)
+ VisualServer::get_singleton()->particles_restart(particles);
}
void Particles2D::set_pre_process_time(float p_time) {
diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h
index 23278ce746..a6ac0c37d3 100644
--- a/scene/2d/particles_2d.h
+++ b/scene/2d/particles_2d.h
@@ -80,7 +80,7 @@ public:
void set_emitting(bool p_emitting);
void set_amount(int p_amount);
void set_lifetime(float p_lifetime);
- void set_one_shot(bool p_enabled);
+ void set_one_shot(bool p_enable);
void set_pre_process_time(float p_time);
void set_explosiveness_ratio(float p_ratio);
void set_randomness_ratio(float p_ratio);
diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h
index b2dae17735..e80817cd3c 100644
--- a/scene/2d/path_2d.h
+++ b/scene/2d/path_2d.h
@@ -96,7 +96,7 @@ public:
void set_loop(bool p_loop);
bool has_loop() const;
- void set_rotate(bool p_enabled);
+ void set_rotate(bool p_rotate);
bool is_rotating() const;
void set_cubic_interpolation(bool p_enable);
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 2f1e8925b8..6ec1642138 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -982,11 +982,12 @@ Dictionary KinematicBody2D::_move(const Vector2 &p_motion) {
if (move(p_motion, col)) {
Dictionary d;
d["position"] = col.collision;
- d["normal"] = col.collision;
+ d["normal"] = col.normal;
d["local_shape"] = col.local_shape;
d["travel"] = col.travel;
d["remainder"] = col.remainder;
d["collider_id"] = col.collider;
+ d["collider_velocity"] = col.collider_vel;
if (col.collider) {
d["collider"] = ObjectDB::get_instance(col.collider);
} else {
diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h
index f2cc9452b9..3cc9db28b6 100644
--- a/scene/2d/polygon_2d.h
+++ b/scene/2d/polygon_2d.h
@@ -84,10 +84,10 @@ public:
void set_texture_scale(const Size2 &p_scale);
Size2 get_texture_scale() const;
- void set_invert(bool p_rot);
+ void set_invert(bool p_invert);
bool get_invert() const;
- void set_invert_border(float p_border);
+ void set_invert_border(float p_invert_border);
float get_invert_border() const;
void set_offset(const Vector2 &p_offset);
diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h
index 8923da2ae4..2a5935aaf1 100644
--- a/scene/2d/screen_button.h
+++ b/scene/2d/screen_button.h
@@ -61,7 +61,7 @@ private:
VisibilityMode visibility;
- void _input(const Ref<InputEvent> &p_Event);
+ void _input(const Ref<InputEvent> &p_event);
bool _is_point_inside(const Point2 &p_point);
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index e4494742a1..68b026b1b3 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -1068,20 +1068,20 @@ Transform2D TileMap::get_custom_transform() const {
return custom_transform;
}
-Vector2 TileMap::_map_to_world(int x, int y, bool p_ignore_ofs) const {
+Vector2 TileMap::_map_to_world(int p_x, int p_y, bool p_ignore_ofs) const {
- Vector2 ret = get_cell_transform().xform(Vector2(x, y));
+ Vector2 ret = get_cell_transform().xform(Vector2(p_x, p_y));
if (!p_ignore_ofs) {
switch (half_offset) {
case HALF_OFFSET_X: {
- if (ABS(y) & 1) {
+ if (ABS(p_y) & 1) {
ret += get_cell_transform()[0] * 0.5;
}
} break;
case HALF_OFFSET_Y: {
- if (ABS(x) & 1) {
+ if (ABS(p_x) & 1) {
ret += get_cell_transform()[1] * 0.5;
}
} break;