summaryrefslogtreecommitdiff
path: root/scene/gui/color_rect.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-09-11 11:28:01 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-09-11 11:28:01 -0300
commit95eb7466df890dcbed9eb8e8bda15bd9235db9c0 (patch)
tree6c23afb3abef8e539c42d1024a0fa213bc98692b /scene/gui/color_rect.cpp
parent1bf684cea274db7c58b3f62a77ad4de3980c14dc (diff)
-Added a ColorFrame control, kind of like Texture but for color.
-Added dropping nodes to text editor for them to become a path -Fixed issues with font not properly being set in code editor
Diffstat (limited to 'scene/gui/color_rect.cpp')
-rw-r--r--scene/gui/color_rect.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp
new file mode 100644
index 0000000000..a0e4df66b5
--- /dev/null
+++ b/scene/gui/color_rect.cpp
@@ -0,0 +1,36 @@
+#include "color_rect.h"
+
+
+
+
+void ColorFrame::set_frame_color(const Color& p_color) {
+
+ color=p_color;
+ update();
+}
+
+Color ColorFrame::get_frame_color() const{
+
+ return color;
+}
+
+void ColorFrame::_notification(int p_what) {
+
+ if (p_what==NOTIFICATION_DRAW) {
+ draw_rect(Rect2(Point2(),get_size()),color);
+ }
+}
+
+void ColorFrame::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("set_frame_color","color"),&ColorFrame::set_frame_color);
+ ObjectTypeDB::bind_method(_MD("get_frame_color"),&ColorFrame::get_frame_color);
+
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_frame_color"),_SCS("get_frame_color") );
+}
+
+ColorFrame::ColorFrame() {
+
+ color=Color(1,1,1);
+}
+