Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (15 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/overlays/OverlayText.cc

    r3110 r3196  
    3131#include <OgreOverlayManager.h>
    3232#include <OgrePanelOverlayElement.h>
     33#include <OgreTextAreaOverlayElement.h>
     34#include <boost/static_assert.hpp>
    3335
    3436#include "util/String.h"
     
    3638#include "core/XMLPort.h"
    3739
     40
    3841namespace orxonox
    3942{
    4043    CreateFactory(OverlayText);
     44
     45    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left);
     46    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center);
     47    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right);
    4148
    4249    OverlayText::OverlayText(BaseObject* creator)
     
    7683    }
    7784
    78     void OverlayText::setFont(const std::string& font)
    79     {
    80         if (font != "")
    81             this->text_->setFontName(font);
    82     }
    83 
    8485    void OverlayText::setAlignmentString(const std::string& alignment)
    8586    {
    8687        if (alignment == "right")
    87             this->setAlignment(Ogre::TextAreaOverlayElement::Right);
     88            this->setAlignment(OverlayText::Right);
    8889        else if (alignment == "center")
    89             this->setAlignment(Ogre::TextAreaOverlayElement::Center);
     90            this->setAlignment(OverlayText::Center);
    9091        else // "left" and default
    91             this->setAlignment(Ogre::TextAreaOverlayElement::Left);
     92            this->setAlignment(OverlayText::Left);
    9293    }
    9394
     
    120121        positionChanged();
    121122    }
     123
     124    void OverlayText::setCaption(const std::string& caption)
     125    {
     126        this->text_->setCaption(caption);
     127        this->changedCaption();
     128    }
     129    std::string OverlayText::getCaption() const
     130    {
     131        return this->text_->getCaption();
     132    }
     133
     134    void OverlayText::setFont(const std::string& font)
     135    {
     136        if (font != "")
     137            this->text_->setFontName(font);
     138    }
     139    const std::string& OverlayText::getFont() const
     140    {
     141        return this->text_->getFontName();
     142    }
     143
     144    void OverlayText::setSpaceWidth(float width)
     145    {
     146        this->text_->setSpaceWidth(width);
     147    }
     148    float OverlayText::getSpaceWidth() const
     149    {
     150        return this->text_->getSpaceWidth();
     151    }
     152
     153    void OverlayText::setColour(const ColourValue& colour)
     154    {
     155        this->text_->setColour(colour); this->changedColour();
     156    }
     157    const ColourValue& OverlayText::getColour() const
     158    {
     159        return this->text_->getColour();
     160    }
     161
     162    void OverlayText::setAlignment(OverlayText::Alignment alignment)
     163    {
     164        this->text_->setAlignment(static_cast<Ogre::TextAreaOverlayElement::Alignment>(alignment));
     165    }
     166    OverlayText::Alignment OverlayText::getAlignment() const
     167    {
     168        return static_cast<OverlayText::Alignment>(this->text_->getAlignment());
     169    }
    122170}
Note: See TracChangeset for help on using the changeset viewer.