-
Notifications
You must be signed in to change notification settings - Fork 5
/
tiledmapeditor.h
77 lines (63 loc) · 1.8 KB
/
tiledmapeditor.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef TILEDMAPEDITOR_H
#define TILEDMAPEDITOR_H
#include <QWidget>
#include <QPixmap>
#include <QPainter>
#include <QMouseEvent>
#include <QScrollArea>
#include "tilebuffer.h"
#include "tilemap.h"
#include "animationbuffer.h"
#include "eventmatrix.h"
class TiledMapEditor : public QWidget
{
Q_OBJECT
public:
explicit TiledMapEditor(QWidget *parent = 0);
~TiledMapEditor();
void setTileBuffer(TileBuffer *tilebuffer);
void setTileMap(TileMap *tilemap);
void setAnimationBuffer(AnimationBuffer *animbuffer);
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *ev);
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void leaveEvent(QEvent *);
void setTileSize(int x, int y);
void setCursorTiles(QVector<QVector<int> > cur);
QVector<QVector<int> > getCursorTiles();
void setVisibleRect(QRect rect);
void setSelectionMode(bool mode);
bool isInSelectionMode();
QVector <QVector<int> > getSelectionMap();
QRect getSelectionRect();
void fillWithTileCursor();
QPixmap *getMapPixmap() const;
void addTransparentLayer(TileMap * map);
void setEventMatrix(EventMatrix *ev);
void showEventMatrix();
void hideEventMatrix();
signals:
void mouseMove(int x, int y);
void scrollDir(int x, int y);
void editingFinished();
public slots:
private:
// QPixmap *MapImg;
QRect VisibleRect;
int TileSizeX, TileSizeY;
bool isModified;
bool isMouseHovering;
bool isMouseDown;
bool isSelectionModeOn;
QRect SelectionRect;
QPoint Cursor;
QVector<QVector<int> > CursorTiles;
TileBuffer *Buffer;
TileMap *Map;
AnimationBuffer * AnimBuffer;
QVector<TileMap * > TranMaps;
EventMatrix *Matrix;
bool isMatrixVisible;
};
#endif // TILEDMAPEDITOR_H