-
Notifications
You must be signed in to change notification settings - Fork 5
/
animationeditor.h
57 lines (46 loc) · 1.39 KB
/
animationeditor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef ANIMATIONEDITOR_H
#define ANIMATIONEDITOR_H
#include <QWidget>
#include <QPixmap>
#include <QPainter>
#include <QMouseEvent>
#include "tilebuffer.h"
#include "animationbuffer.h"
class AnimationEditor : public QWidget
{
Q_OBJECT
public:
explicit AnimationEditor(QWidget *parent = 0);
~AnimationEditor();
void setTileBuffer(TileBuffer *tilebuffer);
void setAnimationBuffer(AnimationBuffer *animbuffer);
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *ev);
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void leaveEvent(QEvent *);
void setCursorTiles(QVector<QVector<int> > cur);
int getSelectedAnimation();
signals:
void onAnimationSelected();
void editingFinished();
public slots:
private:
void AddAnimation();
void AddFramesFromCursorTo(int AnimationIndex);
int TileSizeX, TileSizeY;
bool isMouseHovering;
bool isMouseDown;
QPoint Cursor;
QVector<QVector<int> > CursorTiles;
TileBuffer *Buffer;
AnimationBuffer *AnimBuffer;
QRect HiglightRect;
QRect GrabbedAreaRect;
int BiggestAnimation;
int MouseHoverIndex; //-1 - brak, 0..animbuffer.size-1 - dodaj do animacji, animbuffer.size - dodaj animację
int RemoveIndex; //-1 -dodaj, 0..animbuffer.size-1-usuń
QPixmap *PlusIconImg;
QPixmap *DeleteIconImg;
};
#endif // ANIMATIONEDITOR_H