1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DEXTRAS_QABSTRACTSPRITESHEET_H
5#define QT3DEXTRAS_QABSTRACTSPRITESHEET_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DCore/QNode>
9#include <Qt3DRender/qabstracttexture.h>
10#include <QtGui/QVector2D>
11#include <QtGui/QMatrix3x3>
12
13QT_BEGIN_NAMESPACE
14
15namespace Qt3DExtras {
16
17class QAbstractSpriteSheetPrivate;
18
19class Q_3DEXTRASSHARED_EXPORT QAbstractSpriteSheet : public Qt3DCore::QNode
20{
21 Q_OBJECT
22 Q_PROPERTY(Qt3DRender::QAbstractTexture *texture READ texture WRITE setTexture NOTIFY textureChanged)
23 Q_PROPERTY(QMatrix3x3 textureTransform READ textureTransform NOTIFY textureTransformChanged)
24 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
25public:
26 ~QAbstractSpriteSheet();
27
28 Qt3DRender::QAbstractTexture *texture() const;
29 QMatrix3x3 textureTransform() const;
30 int currentIndex() const;
31
32public Q_SLOTS:
33 void setTexture(Qt3DRender::QAbstractTexture *texture);
34 void setCurrentIndex(int currentIndex);
35
36Q_SIGNALS:
37 void textureChanged(Qt3DRender::QAbstractTexture *texture);
38 void textureTransformChanged(const QMatrix3x3 &textureTransform);
39 void currentIndexChanged(int currentIndex);
40
41protected:
42 explicit QAbstractSpriteSheet(QAbstractSpriteSheetPrivate &d, Qt3DCore::QNode *parent = nullptr);
43
44private:
45 Q_DECLARE_PRIVATE(QAbstractSpriteSheet)
46};
47
48} // Qt3DExtras
49
50QT_END_NAMESPACE
51
52#endif // QT3DEXTRAS_QABSTRACTSPRITESHEET_H
53

source code of qt3d/src/extras/defaults/qabstractspritesheet.h