1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

-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
This commit is contained in:
Juan Linietsky
2016-09-11 11:28:01 -03:00
parent 1bf684cea2
commit 95eb7466df
10 changed files with 220 additions and 4 deletions

36
scene/gui/color_rect.cpp Normal file
View File

@@ -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);
}