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

Made it possible to properly draw over the 2D canvas for 2D objects. Arranged some functions to achieve this.

This commit is contained in:
Juan Linietsky
2016-09-10 16:44:03 -03:00
parent 67d3935eb1
commit 491dde2eb4
14 changed files with 95 additions and 39 deletions

View File

@@ -6681,45 +6681,54 @@ EditorNode::~EditorNode() {
void EditorPluginList::make_visible(bool p_visible) {
if (!plugins_list.empty()) {
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->make_visible(p_visible);
}
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->make_visible(p_visible);
}
}
void EditorPluginList::edit(Object* p_object) {
if (!plugins_list.empty()) {
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->edit(p_object);
}
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->edit(p_object);
}
}
bool EditorPluginList::forward_input_event(const InputEvent& p_event) {
bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) {
bool discard = false;
if (!plugins_list.empty()) {
for (int i = 0; i < plugins_list.size(); i++) {
if (plugins_list[i]->forward_input_event(p_event)) {
discard = true;
}
for (int i = 0; i < plugins_list.size(); i++) {
if (plugins_list[i]->forward_canvas_input_event(p_canvas_xform,p_event)) {
discard = true;
}
}
return discard;
}
bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event) {
bool discard = false;
if (!plugins_list.empty()) {
for (int i = 0; i < plugins_list.size(); i++) {
if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) {
discard = true;
}
for (int i = 0; i < plugins_list.size(); i++) {
if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) {
discard = true;
}
}
return discard;
}
void EditorPluginList::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas) {
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->forward_draw_over_canvas(p_canvas_xform,p_canvas);
}
}
bool EditorPluginList::empty() {
return plugins_list.empty();
}