Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2009, 10:42:56 PM (15 years ago)
Author:
dafrick
Message:

Got the Notifications to work. Rudimentarily, at least… \nNow comes the polish…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h

    r2779 r2781  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "orxonox/overlays/OrxonoxOverlay.h"
     34#include "orxonox/overlays/OverlayText.h"
    3535
    3636#include <string>
     
    4848        Damian 'Mozork' Frick
    4949    */
    50     class _OrxonoxExport NotificationOverlay : public OrxonoxOverlay
     50    class _OrxonoxExport NotificationOverlay : public OverlayText
    5151    {
    52    
    53         friend class NotificationQueue; //TDO: Best solution?
    54    
     52
    5553        public:
    5654            NotificationOverlay(BaseObject* creator);
     
    5957           
    6058            bool processNotification(Notification* notification);
     59
     60            void setFontSize(float size)
     61                { this->setTextSize(size); }
    6162       
    6263        protected:
    6364            const std::string clipMessage(const std::string & message);
    64             const std::string clipMessage2(const std::string & message); //Outdated
    65        
     65
    6666        private:
    6767            NotificationQueue* queue_;
    6868            Notification* notification_;
    69            
    70             int width_;
    71            
    72             Ogre::TextAreaOverlayElement* notificationText_;
    73            
     69
    7470            void initialize(void);
    7571            void defineOverlay(void);
    76 
    77             virtual void sizeChanged();
    78 
    79             void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment)
    80                 { this->notificationText_->setAlignment(alignment); }
    81             void setCaption(const std::string& caption)
    82                 { this->notificationText_->setCaption(caption); }
    83             void setColour(const ColourValue& colour)
    84                 { this->notificationText_->setColour(colour); }
    85             void setFont(const std::string & font);
    86             void setFontSize(float size);
    87             void setWidth(int width);
    88             void setAlignmentString(const std::string& alignment);
    89             void setTextSize(float size)
    90                 { this->setSize(Vector2(size, size)); }
    91            
    92             Ogre::TextAreaOverlayElement::Alignment getAlignment() const
    93                 { return this->notificationText_->getAlignment(); }
    94             std::string getCaption() const
    95                 { return this->notificationText_->getCaption(); }
    96             float getFontSize(void) const;
    97             const std::string & getFont(void) const
    98                 { return this->notificationText_->getFontName(); }
    99             int getWidth(void) const
    100                 { return this->width_; }
    101             const ColourValue& getColour() const
    102                 { return this->notificationText_->getColour(); }
    103             std::string getAlignmentString() const;
    104             float getTextSize() const
    105                 { return this->getSize().y; }
    10672
    10773    };
Note: See TracChangeset for help on using the changeset viewer.