mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-02 22:35:55 +01:00
Added PaintNode.
This commit is contained in:
parent
b574d44dd7
commit
1c0c3c4393
@ -33,6 +33,8 @@ module_env.add_source_files(env.modules_sources,"ui/paint_visual_grid.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"paint_utilities.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"bush_prefabs.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"nodes/paint_node.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"deprecated/paint_canvas_layer.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"deprecated/paint_canvas.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"deprecated/paint_layer_button.cpp")
|
||||
|
20
modules/paint/nodes/paint_node.cpp
Normal file
20
modules/paint/nodes/paint_node.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "paint_node.h"
|
||||
|
||||
Vector2i PaintNode::get_size() {
|
||||
return _size;
|
||||
}
|
||||
void PaintNode::set_size(const Vector2i &size) {
|
||||
_size = size;
|
||||
}
|
||||
|
||||
PaintNode::PaintNode() {
|
||||
}
|
||||
|
||||
PaintNode::~PaintNode() {
|
||||
}
|
||||
|
||||
void PaintNode::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_size"), &PaintNode::get_size);
|
||||
ClassDB::bind_method(D_METHOD("set_size", "size"), &PaintNode::set_size);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "size"), "set_size", "get_size");
|
||||
}
|
24
modules/paint/nodes/paint_node.h
Normal file
24
modules/paint/nodes/paint_node.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef PAINT_NODE_H
|
||||
#define PAINT_NODE_H
|
||||
|
||||
#include "core/math/vector2i.h"
|
||||
|
||||
#include "scene/2d/node_2d.h"
|
||||
|
||||
class PaintNode : public Node2D {
|
||||
GDCLASS(PaintNode, Node2D);
|
||||
|
||||
public:
|
||||
Vector2i get_size();
|
||||
void set_size(const Vector2i &size);
|
||||
|
||||
PaintNode();
|
||||
~PaintNode();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
Vector2i _size;
|
||||
};
|
||||
|
||||
#endif
|
@ -44,6 +44,8 @@ SOFTWARE.
|
||||
#include "ui/paint_selection_box.h"
|
||||
#include "ui/paint_visual_grid.h"
|
||||
|
||||
#include "nodes/paint_node.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "paint_editor_plugin.h"
|
||||
#endif
|
||||
@ -71,6 +73,8 @@ void register_paint_types() {
|
||||
ClassDB::register_class<PaintSelectionBox>();
|
||||
ClassDB::register_class<PaintVisualGrid>();
|
||||
|
||||
ClassDB::register_class<PaintNode>();
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
EditorPlugins::add_by_type<PaintEditorPlugin>();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user