Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2011, 10:45:56 PM (14 years ago)
Author:
dafrick
Message:

Extending NotificationQueueCEGUI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.h

    r8446 r8448  
    3939
    4040#include <string>
     41#include "util/Math.h"
    4142
    4243#include "NotificationManager.h"
     44
    4345#include "NotificationQueue.h"
    4446
     
    4648{ // tolua_export
    4749
    48     //TODO: Update.
    4950    /**
    5051    @brief
    51         Displays @ref orxonox::Notification "Notifications" from specific senders.
     52        Displays @ref orxonox::Notification "Notifications" using CEGUI.
    5253
    53         There are quite some parameters that influence the behavior of the NotificationQueue:
    54         - @b name The name of the NotificationQueue. It needs to be unique.
    55         - @b senders The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
    56         - @b size The size of the NotificationQueue, it specifies how many @ref orxonox::Notification "Notifications" are displayed at once at the most.
    57         - @b displayTime The time a @ref orxonox::Notification "Notification" is displayed with this NotificationQueue.
     54        Apart form the parameters inherited by the @ref orxonox::NotificationQueue "NotificationQueue", there are some more parameters that influence the behavior of the NotificationQueueCEGUI:
     55        - @b displaySize The size of the window that displays the NotificationQueue.
     56        - @b position The position if the window that displays the NotificationQueue.
     57        - @b alignment The horizontal alignment of the displayed Notifications.
     58        - @b fontSize The font size of the displayed Notifications.
     59        - @b fontColor The font color of the displayed Notifications.
    5860
    5961    @author
    6062        Damian 'Mozork' Frick
    6163
     64    @see NotificationQueue
    6265    @ingroup Notifications
    6366    */
     
    7073            virtual ~NotificationQueueCEGUI();
    7174
    72             //! Destroys the NotificationQueue.
    73             void destroy(bool noGraphics = false); // tolua_export
     75            void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
     76
     77            /**
     78            @brief Set the size of the window that displays the NotificationQueue.
     79            @param size A vector whose first component is the relative width of the window (a value between 0 and 1) and whose second component is the absolute width in pixels (additional to the relative width, can be negative). The height is set such that exactly as many Notifications fit as is the maximum size of the NotificationQueue (in terms of the number of Notifications).
     80            */
     81            inline void setDisplaySize(const Vector2& size)
     82                { this->setDisplaySize(Vector4(size.x, size.y, 0.0, 0.0)); }
     83            void setDisplaySize(const Vector4& size); // Set the size of the window that displays the NotificationQueue.
     84            /**
     85            @brief Get the size of the window that displays the NotificationQueue.
     86            @return Returns a vector with the display size.
     87            */
     88            inline const Vector4& getDisplaySize(void) const
     89                { return this->displaySize_; }
     90
     91            void setPosition(const Vector4& position); // Set the position of the window that displays the NotificationQueue.
     92            /**
     93            @brief Get the position of the window that displays the NotificationQueue.
     94            @return Returns a vector with the position.
     95            */
     96            inline const Vector4& getPosition(void) const
     97                { return this->position_; }
     98
     99            void setAlignment(const std::string& alignment); // Set the horizontal alignment of the Notifications text.
     100            /**
     101            @brief Get the horizontal alignment of the Notifications text.
     102            @return Returns a string with the horizontal alignment property.
     103            */
     104            inline const std::string& getAlignment(void)
     105                { return this->alignment_; }
     106
     107            void setFontSize(unsigned int size); // Set the font size of the text displayed by this NotificationQueue.
     108            /**
     109            @brief Get the font size of the text displayed by this NotificationQueue.
     110            @return Returns the font size.
     111            */
     112            inline unsigned int getFontSize(void)
     113                { return this->fontSize_; }
     114
     115            void setFontColor(const Vector4& color); // Set the font color if the text displayed by this NotificationQueue.
     116            /**
     117            @brief Get the font color of the text displayed by this NotificationQueue.
     118            @return Returns a vector with the components being RGBA, with values from 0 to 1.
     119            */
     120            inline const Vector4& getFontColor(void) const
     121                { return this->fontColor_; }
     122            /**
     123            @brief Get the font color of the text displayed by this NotificationQueue.
     124            @return Returns a string with the ARGB values in hexadecimal format.
     125            */
     126            inline const std::string& getFontColorStr(void) const
     127                { return this->fontColorStr_; }
     128
     129            static NotificationQueueCEGUI* getQueue(const std::string& name); // tolua_export
    74130           
    75131        protected:
     
    81137           
    82138        private:
    83             void create(void); // Creates the NotificationQueue in lua.           
     139            Vector4 displaySize_; //!< The size of the window that displays the NotificationQueue.
     140            Vector4 position_; //!< The position of the window that displays the NotificationQueue.
     141            std::string alignment_; //!< The horizontal alignment of the Notifications text.
     142            unsigned int fontSize_; //!< The font size of the Notifications text.
     143            Vector4 fontColor_; //!< The font color of the Notifications text as a vector, in RGBA form, with values from 0 to 1.
     144            std::string fontColorStr_; //!< The font color of the Notifications text as a string with the ARGB hexadecimal values.
     145           
     146            void create(void); // Creates the NotificationQueue in lua.
    84147
    85148    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.