Create spritesheet for SpriteFrames by drag and dropping.

Close godotengine/godot-proposals#378
This commit is contained in:
dankan1890 2021-01-12 00:51:59 +01:00
parent 8e514bbf6a
commit 390ff22a8c
1 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,7 @@
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/io/resource_loader.h" #include "core/io/resource_loader.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "scene/3d/sprite_3d.h" #include "scene/3d/sprite_3d.h"
@ -952,9 +953,13 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
if (String(d["type"]) == "files") { if (String(d["type"]) == "files") {
Vector<String> files = d["files"]; Vector<String> files = d["files"];
if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) {
_prepare_sprite_sheet(files[0]);
} else {
_file_load_request(files, at_pos); _file_load_request(files, at_pos);
} }
} }
}
void SpriteFramesEditor::_bind_methods() { void SpriteFramesEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false)); ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false));