Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 22, 2008, 12:06:55 AM (16 years ago)
Author:
rgrieder
Message:
  • added blankString to String so you can return ""; even if it's a const std::string&
  • fixed several bugs with aspect correct and margin alignment
  • added console commands for OrxonoxOverlays and OverlayGroups for rotate, scale and scroll (you can access the by name (from name=.. in xml file), e.g. "OrxonoxOverlay rotateOverlay SpeedBar 90)
  • converted everything in overlays/ to 4 spaces/tab ;)
  • removed all using namespace Ogre;
  • added background_ Panel to OrxonoxOverlay, since most of the derived classes can use that
  • should work now, but I'll have to test on a tardis box first
File:
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/OverlayText.h

    r1614 r1615  
    2727 */
    2828
    29 #ifndef _HUDText_H__
    30 #define _HUDText_H__
     29#ifndef _OverlayText_H__
     30#define _OverlayText_H__
    3131
    3232#include "OrxonoxPrereqs.h"
     
    3434#include <string>
    3535#include <OgrePrerequisites.h>
    36 #include "overlays/OrxonoxOverlay.h"
     36#include "OrxonoxOverlay.h"
    3737
    3838namespace orxonox
    3939{
    40   class _OrxonoxExport HUDText : public OrxonoxOverlay
    41   {
    42   public:
    43     HUDText();
    44     virtual ~HUDText();
     40    class _OrxonoxExport OverlayText : public OrxonoxOverlay
     41    {
     42    public:
     43        OverlayText();
     44        virtual ~OverlayText();
    4545
    46     virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     46        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    4747
    48   protected:
    49     void setCaption(const std::string& caption);
    50     const std::string& getCaption() const;
    51     void setFont(const std::string& font);
    52     std::string getFont() const;
     48    protected:
     49        virtual void sizeChanged();
    5350
    54     Ogre::TextAreaOverlayElement* text_;
     51        void setCaption(const std::string& caption) { this->caption_ = caption; }
     52        const std::string& getCaption() const       { return this->caption_; }
    5553
    56   private:
    57     std::string caption_;
    58   };
     54        void setFont(const std::string& font);
     55        const std::string& getFont() const;
     56
     57        void setTextSize(float size) { this->setSize(Vector2(size, size)); }
     58        float getTextSize() const    { return this->getUncorrectedSize().y; }
     59
     60        Ogre::TextAreaOverlayElement* text_;
     61
     62    private:
     63        std::string caption_;
     64    };
    5965}
    60 #endif /* _HUDText_H__ */
     66#endif /* _OverlayText_H__ */
Note: See TracChangeset for help on using the changeset viewer.