summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-11-02 11:31:01 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-11-02 11:31:01 -0300
commitd85b67be53bac252c0a28b799d56d1b359c4ee99 (patch)
tree5227e145e3271bfee542bdd3e4237c3378565306 /scene/gui
parent738eb2c1a88d441eacc4149ce8f1c12a90267191 (diff)
Bug Fixes
-=-=-=-=- -Fixed problem with scaling shapes (#827), related to not taking scale in consideration for calculating the moment of inertia -Added support for multiline strings (or comments) using """ -Save subscene bug, properties not being saved in root node (#806) -Fix Crash in CollisionPolygon2DEditor (#814) -Restored Ability to compile without 3D (#795) -Fix InterpolatedCamera (#803) -Fix UV Import for OBJ Meshes (#771) -Fixed issue with modifier gizmos (#794) -Fixed CapsuleShape gizmo handle (#50) -Fixed Import Button (not properly working in 3D) (#733) -Many misc fixes (though no new features)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp8
-rw-r--r--scene/gui/base_button.h20
-rw-r--r--scene/gui/video_player.cpp25
3 files changed, 30 insertions, 23 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 7745ce11fc..cf9fcfa72a 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -346,6 +346,8 @@ bool BaseButton::get_click_on_press() const {
}
+
+
void BaseButton::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_input_event"),&BaseButton::_input_event);
@@ -358,6 +360,7 @@ void BaseButton::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_disabled"),&BaseButton::is_disabled);
ObjectTypeDB::bind_method(_MD("set_click_on_press","enable"),&BaseButton::set_click_on_press);
ObjectTypeDB::bind_method(_MD("get_click_on_press"),&BaseButton::get_click_on_press);
+ ObjectTypeDB::bind_method(_MD("get_draw_mode"),&BaseButton::get_draw_mode);
ADD_SIGNAL( MethodInfo("pressed" ) );
ADD_SIGNAL( MethodInfo("toggled", PropertyInfo( Variant::BOOL,"pressed") ) );
@@ -365,6 +368,11 @@ void BaseButton::_bind_methods() {
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "toggle_mode"), _SCS("set_toggle_mode"), _SCS("is_toggle_mode"));
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "click_on_press"), _SCS("set_click_on_press"), _SCS("get_click_on_press"));
+ BIND_CONSTANT( DRAW_NORMAL );
+ BIND_CONSTANT( DRAW_PRESSED );
+ BIND_CONSTANT( DRAW_HOVER );
+ BIND_CONSTANT( DRAW_DISABLED );
+
}
BaseButton::BaseButton() {
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index a2c640b9cf..a376591ebb 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -61,15 +61,8 @@ class BaseButton : public Control {
protected:
- enum DrawMode {
- DRAW_NORMAL,
- DRAW_PRESSED,
- DRAW_HOVER,
- DRAW_DISABLED,
- };
- DrawMode get_draw_mode() const;
virtual void pressed();
virtual void toggled(bool p_pressed);
@@ -78,7 +71,16 @@ protected:
void _notification(int p_what);
public:
-
+
+ enum DrawMode {
+ DRAW_NORMAL,
+ DRAW_PRESSED,
+ DRAW_HOVER,
+ DRAW_DISABLED,
+ };
+
+ DrawMode get_draw_mode() const;
+
/* Signals */
bool is_pressed() const; ///< return wether button is pressed (toggled in)
@@ -101,4 +103,6 @@ public:
};
+VARIANT_ENUM_CAST( BaseButton::DrawMode );
+
#endif
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 9a1c070529..0d77560d7b 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -45,20 +45,15 @@ void VideoPlayer::_notification(int p_notification) {
return;
if (paused)
return;
+ if (!stream->is_playing())
+ return;
stream->update(get_scene()->get_idle_process_time());
- while (stream->get_pending_frame_count()) {
-
- Image img = stream->pop_frame();
- if (texture->get_width() == 0) {
- texture->create(img.get_width(),img.get_height(),img.get_format(),Texture::FLAG_VIDEO_SURFACE|Texture::FLAG_FILTER);
- update();
- minimum_size_changed();
- } else {
-
- if (stream->get_pending_frame_count() == 0)
- texture->set_data(img);
- };
+ int prev_width = texture->get_width();
+ stream->pop_frame(texture);
+ if (prev_width == 0) {
+ update();
+ minimum_size_changed();
};
} break;
@@ -257,9 +252,9 @@ void VideoPlayer::_bind_methods() {
VideoPlayer::VideoPlayer() {
volume=1;
- loops=false;
- paused=false;
- autoplay=false;
+ loops = false;
+ paused = false;
+ autoplay = false;
expand = true;
loops = false;
};