mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-11 11:26:00 -05:00
Add layering to scripting overlay
This commit is contained in:
@@ -67,11 +67,11 @@ public:
|
||||
Q_INVOKABLE void setDimensions(int width, int height);
|
||||
Q_INVOKABLE void setWidth(int width);
|
||||
Q_INVOKABLE void setHeight(int height);
|
||||
Q_INVOKABLE void clearOverlay();
|
||||
Q_INVOKABLE void addText(QString text, int x, int y, QString color = "#000000", int fontSize = 12);
|
||||
Q_INVOKABLE void addRect(int x, int y, int width, int height, QString color = "#000000");
|
||||
Q_INVOKABLE void addFilledRect(int x, int y, int width, int height, QString color = "#000000");
|
||||
Q_INVOKABLE void addImage(int x, int y, QString filepath, int width = -1, int height = -1, unsigned offset = 0, bool hflip = false, bool vflip = false, bool setTransparency = false);
|
||||
Q_INVOKABLE void clearOverlay(int layer = INT_MAX);
|
||||
Q_INVOKABLE void addText(QString text, int x, int y, QString color = "#000000", int fontSize = 12, int layer = 0);
|
||||
Q_INVOKABLE void addRect(int x, int y, int width, int height, QString color = "#000000", int layer = 0);
|
||||
Q_INVOKABLE void addFilledRect(int x, int y, int width, int height, QString color = "#000000", int layer = 0);
|
||||
Q_INVOKABLE void addImage(int x, int y, QString filepath, int width = -1, int height = -1, unsigned offset = 0, bool hflip = false, bool vflip = false, bool setTransparency = false, int layer = 0);
|
||||
void refreshAfterPaletteChange(Tileset *tileset);
|
||||
void setTilesetPalette(Tileset *tileset, int paletteIndex, QList<QList<int>> colors);
|
||||
Q_INVOKABLE void setPrimaryTilesetPalette(int paletteIndex, QList<QList<int>> colors);
|
||||
|
||||
@@ -12,11 +12,13 @@ class GraphicsView : public QGraphicsView
|
||||
public:
|
||||
GraphicsView() : QGraphicsView() {}
|
||||
GraphicsView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
Overlay * getOverlay(int layer);
|
||||
void clearOverlays();
|
||||
|
||||
public:
|
||||
// GraphicsView_Object object;
|
||||
Editor *editor;
|
||||
Overlay overlay;
|
||||
QMap<int, Overlay*> overlayMap;
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
~Overlay() {
|
||||
this->clearItems();
|
||||
}
|
||||
void renderItems(QPainter *painter);
|
||||
QList<OverlayItem*> getItems();
|
||||
void clearItems();
|
||||
void addText(QString text, int x, int y, QString color = "#000000", int fontSize = 12);
|
||||
|
||||
Reference in New Issue
Block a user