You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Ability to create sprite frames in AnimatedSprite from sprite sheet.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "scene/gui/file_dialog.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/gui/tree.h"
|
||||
|
||||
class SpriteFramesEditor : public HSplitContainer {
|
||||
@@ -44,6 +45,7 @@ class SpriteFramesEditor : public HSplitContainer {
|
||||
GDCLASS(SpriteFramesEditor, HSplitContainer);
|
||||
|
||||
ToolButton *load;
|
||||
ToolButton *load_sheet;
|
||||
ToolButton *_delete;
|
||||
ToolButton *copy;
|
||||
ToolButton *paste;
|
||||
@@ -71,6 +73,14 @@ class SpriteFramesEditor : public HSplitContainer {
|
||||
|
||||
StringName edited_anim;
|
||||
|
||||
ConfirmationDialog *split_sheet_dialog;
|
||||
TextureRect *split_sheet_preview;
|
||||
SpinBox *split_sheet_h;
|
||||
SpinBox *split_sheet_v;
|
||||
EditorFileDialog *file_split_sheet;
|
||||
Set<int> frames_selected;
|
||||
int last_frame_selected;
|
||||
|
||||
void _load_pressed();
|
||||
void _load_scene_pressed();
|
||||
void _file_load_request(const PoolVector<String> &p_path, int p_at_pos = -1);
|
||||
@@ -99,6 +109,13 @@ class SpriteFramesEditor : public HSplitContainer {
|
||||
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
|
||||
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
|
||||
|
||||
void _open_sprite_sheet();
|
||||
void _prepare_sprite_sheet(const String &p_file);
|
||||
void _sheet_preview_draw();
|
||||
void _sheet_spin_changed(double);
|
||||
void _sheet_preview_input(const Ref<InputEvent> &p_event);
|
||||
void _sheet_add_frames();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
void _gui_input(Ref<InputEvent> p_event);
|
||||
|
||||
Reference in New Issue
Block a user