mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 12:26:59 +01:00
Added current_color property to PaintProject.
This commit is contained in:
parent
d55653d916
commit
4851144a55
@ -1,10 +1,25 @@
|
||||
#include "paint_project.h"
|
||||
|
||||
Color PaintProject::get_current_color() {
|
||||
return _current_color;
|
||||
}
|
||||
void PaintProject::set_current_color(const Color &color) {
|
||||
_current_color = color;
|
||||
|
||||
emit_signal("current_color_changed", _current_color);
|
||||
}
|
||||
|
||||
PaintProject::PaintProject() {
|
||||
_current_color = Color(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
PaintProject::~PaintProject() {
|
||||
}
|
||||
|
||||
void PaintProject::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo("current_color_changed", PropertyInfo(Variant::COLOR, "color")));
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_current_color"), &PaintProject::get_current_color);
|
||||
ClassDB::bind_method(D_METHOD("set_current_color", "size"), &PaintProject::set_current_color);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "current_color"), "set_current_color", "get_current_color");
|
||||
}
|
||||
|
@ -7,11 +7,16 @@ class PaintProject : public PaintNode {
|
||||
GDCLASS(PaintProject, PaintNode);
|
||||
|
||||
public:
|
||||
Color get_current_color();
|
||||
void set_current_color(const Color &color);
|
||||
|
||||
PaintProject();
|
||||
~PaintProject();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
Color _current_color;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user