summaryrefslogtreecommitdiffstats
path: root/scene/gui/color_rect.cpp
blob: a0e4df66b5be3b4823c9d3d23a21f14e90d95303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
}