00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TEXTRENDERERCOMPONENT_H
00022 #define TEXTRENDERERCOMPONENT_H
00023
00024 #include <engine/gluon_engine_export.h>
00025 #include <engine/component.h>
00026
00027 #include <QtGui/QFont>
00028 #include <QtGui/QColor>
00029
00030 namespace GluonEngine
00031 {
00032 class GLUON_ENGINE_EXPORT TextRendererComponent : public Component
00033 {
00034 Q_OBJECT
00035 GLUON_OBJECT( GluonEngine::TextRendererComponent )
00036 Q_PROPERTY( QString text READ text WRITE setText )
00037 Q_PROPERTY( QFont font READ font WRITE setFont )
00038 Q_PROPERTY( QColor color READ color WRITE setColor )
00039 Q_INTERFACES( GluonEngine::Component )
00040
00041 public:
00042 Q_INVOKABLE TextRendererComponent( QObject* parent = 0 );
00043 ~TextRendererComponent();
00044 virtual QString category() const;
00045
00046 virtual QString text() const;
00047 virtual QFont font() const;
00048 virtual QColor color() const;
00049
00050 virtual void initialize();
00051 virtual void start();
00052 virtual void draw( int timeLapse );
00053 virtual void cleanup();
00054
00055 public slots:
00056 virtual void setText( const QString& text );
00057 virtual void setFont( const QFont& font );
00058 virtual void setColor( const QColor& color );
00059
00060 private:
00061 class TextRendererComponentPrivate;
00062 TextRendererComponentPrivate* const d;
00063 };
00064 }
00065
00066 Q_DECLARE_METATYPE( GluonEngine::TextRendererComponent )
00067 Q_DECLARE_METATYPE( GluonEngine::TextRendererComponent* )
00068
00069 #endif // TEXTRENDERERCOMPONENT_H