RigsofRods
Soft-body Physics Simulation
ColoredTextAreaOverlayElement.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5 
6  For more information, see http://www.rigsofrods.org/
7 
8  Rigs of Rods is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License version 3, as
10  published by the Free Software Foundation.
11 
12  Rigs of Rods is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #pragma once
22 
23 #include <vector>
24 #include <Overlay/OgreTextAreaOverlayElement.h>
25 
26 #include "Application.h"
27 
28 class ColoredTextAreaOverlayElement : public Ogre::TextAreaOverlayElement
29 {
30 public:
31  ColoredTextAreaOverlayElement(const Ogre::String& name);
33 
34  void setValueBottom(float Value);
35  void setValueTop(float Value);
36  void setCaption(const Ogre::DisplayString& text);
37  static Ogre::DisplayString StripColors(const Ogre::String& text);
38  static Ogre::ColourValue GetColor(unsigned char ID, float Value = 1.0f);
39 
40  void updateColours(void);
41 
42 protected:
43  std::vector<unsigned char> m_Colors;
44  float m_ValueTop;
46 };
ColoredTextAreaOverlayElement::~ColoredTextAreaOverlayElement
~ColoredTextAreaOverlayElement(void)
Definition: ColoredTextAreaOverlayElement.cpp:38
ColoredTextAreaOverlayElement::setCaption
void setCaption(const Ogre::DisplayString &text)
Definition: ColoredTextAreaOverlayElement.cpp:112
ColoredTextAreaOverlayElement
Definition: ColoredTextAreaOverlayElement.h:28
ColoredTextAreaOverlayElement::m_ValueBottom
float m_ValueBottom
Definition: ColoredTextAreaOverlayElement.h:45
ColoredTextAreaOverlayElement::ColoredTextAreaOverlayElement
ColoredTextAreaOverlayElement(const Ogre::String &name)
Definition: ColoredTextAreaOverlayElement.cpp:31
ColoredTextAreaOverlayElement::m_ValueTop
float m_ValueTop
Definition: ColoredTextAreaOverlayElement.h:44
ColoredTextAreaOverlayElement::m_Colors
std::vector< unsigned char > m_Colors
Definition: ColoredTextAreaOverlayElement.h:43
ColoredTextAreaOverlayElement::StripColors
static Ogre::DisplayString StripColors(const Ogre::String &text)
Definition: ColoredTextAreaOverlayElement.cpp:82
ColoredTextAreaOverlayElement::setValueBottom
void setValueBottom(float Value)
Definition: ColoredTextAreaOverlayElement.cpp:42
ColoredTextAreaOverlayElement::GetColor
static Ogre::ColourValue GetColor(unsigned char ID, float Value=1.0f)
Definition: ColoredTextAreaOverlayElement.cpp:54
Application.h
Central state/object manager and communications hub.
ColoredTextAreaOverlayElement::updateColours
void updateColours(void)
Definition: ColoredTextAreaOverlayElement.cpp:143
ColoredTextAreaOverlayElement::setValueTop
void setValueTop(float Value)
Definition: ColoredTextAreaOverlayElement.cpp:48