summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-02-13 18:03:28 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-02-13 18:03:28 -0300
commit58cda02a389759d18176216c06f375d364cefef1 (patch)
tree4102902585d12ea6807ceaee1370136d29b601e1 /scene/2d
parent1adc330b68b1f6ca18aac05daf88c7d4d757fd0a (diff)
-fixed export templates not loading/exporting on Windows
-fixed TouchScreenButton with stretch2d -fixed(?) OSX crash on startup (test!!) -compilation fixes on windows -CollisionPolygon editor works again -find buttons en find dialog -TileMap editor cleanup (removed "error", made nicer) -viewport flicker fixed -make .scn default extension for saving scenes -export the rest of the network classes to gdscript
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/particles_2d.cpp32
-rw-r--r--scene/2d/particles_2d.h8
-rw-r--r--scene/2d/screen_button.cpp4
3 files changed, 42 insertions, 2 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index c10f60f78b..3d7aa58c6d 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -880,6 +880,26 @@ float Particles2D::get_explosiveness() const{
return explosiveness;
}
+void Particles2D::set_flip_h(bool p_flip) {
+
+ flip_h=p_flip;
+}
+
+bool Particles2D::is_flipped_h() const{
+
+ return flip_h;
+}
+
+void Particles2D::set_flip_v(bool p_flip){
+
+ flip_v=p_flip;
+}
+bool Particles2D::is_flipped_v() const{
+
+ return flip_v;
+}
+
+
void Particles2D::set_emission_points(const DVector<Vector2>& p_points) {
emission_points=p_points;
@@ -922,6 +942,12 @@ void Particles2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset);
ObjectTypeDB::bind_method(_MD("get_emissor_offset"),&Particles2D::get_emissor_offset);
+ ObjectTypeDB::bind_method(_MD("set_flip_h","enable"),&Particles2D::set_flip_h);
+ ObjectTypeDB::bind_method(_MD("is_flipped_h"),&Particles2D::is_flipped_h);
+
+ ObjectTypeDB::bind_method(_MD("set_flip_v","enable"),&Particles2D::set_flip_v);
+ ObjectTypeDB::bind_method(_MD("is_flipped_v"),&Particles2D::is_flipped_v);
+
ObjectTypeDB::bind_method(_MD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents);
ObjectTypeDB::bind_method(_MD("get_emission_half_extents"),&Particles2D::get_emission_half_extents);
@@ -958,6 +984,8 @@ void Particles2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"config/half_extents"),_SCS("set_emission_half_extents"),_SCS("get_emission_half_extents"));
ADD_PROPERTY(PropertyInfo(Variant::BOOL,"config/local_space"),_SCS("set_use_local_space"),_SCS("is_using_local_space"));
ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/explosiveness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_explosiveness"),_SCS("get_explosiveness"));
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL,"config/flip_h"),_SCS("set_flip_h"),_SCS("is_flipped_h"));
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL,"config/flip_v"),_SCS("set_flip_v"),_SCS("is_flipped_v"));
ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"config/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"));
@@ -1039,6 +1067,10 @@ Particles2D::Particles2D() {
set_color_phase_color(2,Color(0,0,0));
set_color_phase_color(3,Color(0,0,0));
+ flip_h=false;
+ flip_v=false;
+
+
emit_timeout = 0;
time_to_live = 0;
explosiveness=1.0;
diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h
index 8849149127..f562e826e0 100644
--- a/scene/2d/particles_2d.h
+++ b/scene/2d/particles_2d.h
@@ -143,6 +143,8 @@ private:
float emit_timeout;
float time_to_live;
float time_scale;
+ bool flip_h;
+ bool flip_v;
Point2 emissor_offset;
Vector2 initial_velocity;
Vector2 extents;
@@ -197,6 +199,12 @@ public:
void set_explosiveness(float p_value);
float get_explosiveness() const;
+ void set_flip_h(bool p_flip);
+ bool is_flipped_h() const;
+
+ void set_flip_v(bool p_flip);
+ bool is_flipped_v() const;
+
void set_color_phases(int p_phases);
int get_color_phases() const;
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index f386dc63e8..871c351479 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -155,7 +155,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) {
- Point2 coord = (get_viewport_transform() * get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {
@@ -231,7 +231,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed!=-1)
return; //already fingering
- Point2 coord = (get_viewport_transform() * get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {