File indexing completed on 2023-10-03 03:29:06
0001 /* 0002 SPDX-FileCopyrightText: 2007 Paolo Capriotti <p.capriotti@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef MESSAGE_H 0008 #define MESSAGE_H 0009 0010 #include <QGraphicsTextItem> 0011 #include <QExplicitlySharedDataPointer> 0012 #include "sprite.h" 0013 0014 class Message : public QGraphicsTextItem, public Sprite 0015 { 0016 public: 0017 Message(const QString& text, const QFont& font, int maxwidth); 0018 0019 void setOpacityF(qreal opacity) override; 0020 qreal opacityF() const override; 0021 0022 void setVelocity(const QPointF& vel) override; 0023 QPointF velocity() const override; 0024 0025 void setPosition(const QPointF& pos) override; 0026 QPointF position() const override; 0027 0028 int height() const; 0029 private: 0030 QPointF m_velocity; 0031 }; 0032 0033 typedef QExplicitlySharedDataPointer<Message> MessagePtr; 0034 0035 #endif // MESSAGE_H