add animation playback

This commit is contained in:
2019-10-19 01:12:58 +02:00
parent 467e83b69e
commit d35ab08ffb
9 changed files with 75 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
#include "node_text.h"
#include "node_checkbox.h"
#include "node_button_custom.h"
#include "node_combobox.h"
class NodeAnimationFrame : public NodeButtonCustom
{
@@ -43,6 +44,9 @@ public:
class NodePanelAnimation : public Node
{
NodeButtonCustom* btn_next = nullptr;
NodeButtonCustom* btn_prev = nullptr;
NodeButtonCustom* btn_play = nullptr;
NodeButtonCustom* btn_add = nullptr;
NodeButtonCustom* btn_remove = nullptr;
NodeButtonCustom* btn_up = nullptr;
@@ -52,8 +56,10 @@ class NodePanelAnimation : public Node
Node* m_frames_container = nullptr;
NodeAnimationFrame* m_selected_frame = nullptr;
NodeAnimationTimeline* m_timeline = nullptr;
NodeComboBox* m_fps = nullptr;
int m_selected_frame_index = -1;
uint32_t m_selected_frame_layer_id = 0;
float m_playback_timer = 0;
public:
using this_class = NodePanelAnimation;
using parent = Node;
@@ -62,7 +68,8 @@ public:
virtual void clone_finalize(Node* dest) const override;
virtual void init() override;
virtual void added(Node* parent) override;
virtual void on_tick(float dt) override;
void init_controls();
void load_layers();
};