OgreTextAreaOverlayElement.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 This source file is a part of OGRE
3 (Object-oriented Graphics Rendering Engine)
4 
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE
25 -------------------------------------------------------------------------*/
26 
27 #ifndef _TextAreaOverlayElement_H__
28 #define _TextAreaOverlayElement_H__
29 
30 #include "OgreOverlayElement.h"
31 #include "OgreFont.h"
32 
33 namespace Ogre
34 {
44  {
45  public:
46  enum Alignment
47  {
50  Center
51  };
52 
53  public:
57 
58  virtual void initialise(void);
59  virtual void setCaption(const DisplayString& text);
60 
61  void setCharHeight( Real height );
63 
64  void setSpaceWidth( Real width );
66 
67  void setFontName( const String& font );
68  const String& getFontName() const;
69 
71  virtual const String& getTypeName(void) const;
73  const MaterialPtr& getMaterial(void) const;
77  void setMaterialName(const String& matName);
78 
85  void setColour(const ColourValue& col);
86 
88  const ColourValue& getColour(void) const;
95  void setColourBottom(const ColourValue& col);
97  const ColourValue& getColourBottom(void) const;
104  void setColourTop(const ColourValue& col);
106  const ColourValue& getColourTop(void) const;
107 
108  inline void setAlignment( Alignment a )
109  {
110  mAlignment = a;
111  mGeomPositionsOutOfDate = true;
112  }
113  inline Alignment getAlignment() const
114  {
115  return mAlignment;
116  }
117 
120 
122  void _update(void);
123 
124  //-----------------------------------------------------------------------------------------
129  {
130  public:
131  String doGet( const void* target ) const;
132  void doSet( void* target, const String& val );
133  };
134  //-----------------------------------------------------------------------------------------
139  {
140  public:
141  String doGet( const void* target ) const;
142  void doSet( void* target, const String& val );
143  };
144  //-----------------------------------------------------------------------------------------
149  {
150  public:
151  String doGet( const void* target ) const;
152  void doSet( void* target, const String& val );
153  };
154  //-----------------------------------------------------------------------------------------
159  {
160  public:
161  String doGet( const void* target ) const;
162  void doSet( void* target, const String& val );
163  };
164  //-----------------------------------------------------------------------------------------
169  {
170  public:
171  String doGet( const void* target ) const;
172  void doSet( void* target, const String& val );
173  };
174  //-----------------------------------------------------------------------------------------
179  {
180  public:
181  String doGet( const void* target ) const;
182  void doSet( void* target, const String& val );
183  };
184  //-----------------------------------------------------------------------------------------
189  {
190  public:
191  String doGet( const void* target ) const;
192  void doSet( void* target, const String& val );
193  };
194  //-----------------------------------------------------------------------------------------
199  {
200  public:
201  String doGet( const void* target ) const;
202  void doSet( void* target, const String& val );
203  };
204 
205  protected:
208 
211 
214 
216  void addBaseParameters(void);
217 
219 
220  // Command objects
228 
229 
235  size_t mAllocSize;
237 
242 
243 
245  void checkMemoryAllocation( size_t numChars );
247  virtual void updatePositionGeometry();
249  virtual void updateTextureGeometry();
251  virtual void updateColours(void);
252  };
255 }
256 
257 #endif
258 
Ogre::TextAreaOverlayElement::CmdColour
Command object for setting the constant colour.
Definition: OgreTextAreaOverlayElement.h:189
Ogre::TextAreaOverlayElement::msCmdCharHeight
static CmdCharHeight msCmdCharHeight
Definition: OgreTextAreaOverlayElement.h:221
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:109
Ogre::TextAreaOverlayElement::msTypeName
static String msTypeName
Definition: OgreTextAreaOverlayElement.h:218
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::TextAreaOverlayElement::updatePositionGeometry
virtual void updatePositionGeometry()
Inherited function.
Ogre::TextAreaOverlayElement::CmdColour::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::mTransparent
bool mTransparent
Flag indicating if this panel should be visual or just group things.
Definition: OgreTextAreaOverlayElement.h:210
OgreFont.h
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::TextAreaOverlayElement::CmdColourTop::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::CmdCaption
Command object for setting the caption.
Definition: OgreTextAreaOverlayElement.h:129
Ogre::TextAreaOverlayElement::setMetricsMode
void setMetricsMode(GuiMetricsMode gmm)
Overridden from OverlayElement.
Ogre::TextAreaOverlayElement::_update
void _update(void)
Overridden from OverlayElement.
Ogre::TextAreaOverlayElement::CmdColourBottom::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::msCmdColour
static CmdColour msCmdColour
Definition: OgreTextAreaOverlayElement.h:224
Ogre::GuiMetricsMode
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
Definition: OgreOverlayElement.h:59
Ogre::TextAreaOverlayElement::mColourBottom
ColourValue mColourBottom
Colours to use for the vertices.
Definition: OgreTextAreaOverlayElement.h:239
Ogre::TextAreaOverlayElement::addBaseParameters
void addBaseParameters(void)
Method for setting up base parameters for this class.
Ogre::TextAreaOverlayElement::mViewportAspectCoef
Real mViewportAspectCoef
Definition: OgreTextAreaOverlayElement.h:236
Ogre::TextAreaOverlayElement::mColourTop
ColourValue mColourTop
Definition: OgreTextAreaOverlayElement.h:240
Ogre::TextAreaOverlayElement::~TextAreaOverlayElement
virtual ~TextAreaOverlayElement()
Ogre::TextAreaOverlayElement::msCmdColourBottom
static CmdColourBottom msCmdColourBottom
Definition: OgreTextAreaOverlayElement.h:226
Ogre::TextAreaOverlayElement::mPixelSpaceWidth
ushort mPixelSpaceWidth
Definition: OgreTextAreaOverlayElement.h:234
Ogre::TextAreaOverlayElement::getSpaceWidth
Real getSpaceWidth() const
Ogre::TextAreaOverlayElement::getMaterial
const MaterialPtr & getMaterial(void) const
See Renderable.
Ogre::TextAreaOverlayElement::getFontName
const String & getFontName() const
Ogre::TextAreaOverlayElement::setColourTop
void setColourTop(const ColourValue &col)
Sets the colour of the top of the letters.
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::TextAreaOverlayElement::CmdCharHeight::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::Right
@ Right
Definition: OgreTextAreaOverlayElement.h:49
Ogre::TextAreaOverlayElement::msCmdFontName
static CmdFontName msCmdFontName
Definition: OgreTextAreaOverlayElement.h:223
Ogre::TextAreaOverlayElement::CmdColourTop
Command object for setting the top colour.
Definition: OgreTextAreaOverlayElement.h:169
Ogre::TextAreaOverlayElement::CmdAlignment::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::CmdAlignment::doGet
String doGet(const void *target) const
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:80
Ogre::TextAreaOverlayElement::getTypeName
virtual const String & getTypeName(void) const
See OverlayElement.
Ogre::TextAreaOverlayElement
This class implements an overlay element which contains simple unformatted text.
Definition: OgreTextAreaOverlayElement.h:44
Ogre::TextAreaOverlayElement::CmdCaption::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::mCharHeight
Real mCharHeight
Definition: OgreTextAreaOverlayElement.h:231
Ogre::TextAreaOverlayElement::CmdAlignment
Command object for setting the alignment.
Definition: OgreTextAreaOverlayElement.h:199
Ogre::TextAreaOverlayElement::Alignment
Alignment
Definition: OgreTextAreaOverlayElement.h:47
Ogre::TextAreaOverlayElement::getColourTop
const ColourValue & getColourTop(void) const
Gets the colour of the top of the letters.
Ogre::TextAreaOverlayElement::setFontName
void setFontName(const String &font)
Ogre::TextAreaOverlayElement::setMaterialName
void setMaterialName(const String &matName)
Overridden from OverlayElement.
Ogre::TextAreaOverlayElement::msCmdAlignment
static CmdAlignment msCmdAlignment
Definition: OgreTextAreaOverlayElement.h:227
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::TextAreaOverlayElement::getRenderOperation
void getRenderOperation(RenderOperation &op)
See Renderable.
Ogre::TextAreaOverlayElement::msCmdColourTop
static CmdColourTop msCmdColourTop
Definition: OgreTextAreaOverlayElement.h:225
Ogre::TextAreaOverlayElement::mSpaceWidth
Real mSpaceWidth
Definition: OgreTextAreaOverlayElement.h:233
Ogre::TextAreaOverlayElement::mColoursChanged
bool mColoursChanged
Definition: OgreTextAreaOverlayElement.h:241
Ogre::TextAreaOverlayElement::CmdFontName::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::CmdFontName
Command object for setting the caption.
Definition: OgreTextAreaOverlayElement.h:159
Ogre::TextAreaOverlayElement::CmdCaption::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::updateColours
virtual void updateColours(void)
Updates vertex colours.
Ogre::TextAreaOverlayElement::checkMemoryAllocation
void checkMemoryAllocation(size_t numChars)
Internal method to allocate memory, only reallocates when necessary.
Ogre::TextAreaOverlayElement::CmdSpaceWidth
Command object for setting the width of a space.
Definition: OgreTextAreaOverlayElement.h:149
Ogre::TextAreaOverlayElement::CmdFontName::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::mPixelCharHeight
ushort mPixelCharHeight
Definition: OgreTextAreaOverlayElement.h:232
Ogre::SharedPtr< Material >
Ogre::TextAreaOverlayElement::getCharHeight
Real getCharHeight() const
Ogre::TextAreaOverlayElement::CmdSpaceWidth::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::setCharHeight
void setCharHeight(Real height)
Ogre::DisplayString
String DisplayString
Definition: OgreOverlayElement.h:53
Ogre::TextAreaOverlayElement::CmdColourBottom::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::getAlignment
Alignment getAlignment() const
Definition: OgreTextAreaOverlayElement.h:113
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:58
Ogre::TextAreaOverlayElement::initialise
virtual void initialise(void)
Initialise gui element.
Ogre::TextAreaOverlayElement::mRenderOp
RenderOperation mRenderOp
Render operation.
Definition: OgreTextAreaOverlayElement.h:213
Ogre::TextAreaOverlayElement::mFont
FontPtr mFont
Definition: OgreTextAreaOverlayElement.h:230
Ogre::TextAreaOverlayElement::TextAreaOverlayElement
TextAreaOverlayElement(const String &name)
Constructor.
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::TextAreaOverlayElement::setCaption
virtual void setCaption(const DisplayString &text)
Sets the caption on elements that support it.
Ogre::TextAreaOverlayElement::setColour
void setColour(const ColourValue &col)
Sets the colour of the text.
Ogre::TextAreaOverlayElement::CmdColour::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::setColourBottom
void setColourBottom(const ColourValue &col)
Sets the colour of the bottom of the letters.
Ogre::TextAreaOverlayElement::getColour
const ColourValue & getColour(void) const
Gets the colour of the text.
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::TextAreaOverlayElement::mAlignment
Alignment mAlignment
The text alignment.
Definition: OgreTextAreaOverlayElement.h:207
Ogre::TextAreaOverlayElement::getColourBottom
const ColourValue & getColourBottom(void) const
Gets the colour of the bottom of the letters.
Ogre::TextAreaOverlayElement::CmdCharHeight
Command object for setting the char height.
Definition: OgreTextAreaOverlayElement.h:139
OgreOverlayElement.h
Ogre::TextAreaOverlayElement::CmdCharHeight::doGet
String doGet(const void *target) const
Ogre::TextAreaOverlayElement::mAllocSize
size_t mAllocSize
Definition: OgreTextAreaOverlayElement.h:235
Ogre::TextAreaOverlayElement::CmdColourTop::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::CmdColourBottom
Command object for setting the bottom colour.
Definition: OgreTextAreaOverlayElement.h:179
Ogre::TextAreaOverlayElement::setAlignment
void setAlignment(Alignment a)
Definition: OgreTextAreaOverlayElement.h:108
Ogre::TextAreaOverlayElement::updateTextureGeometry
virtual void updateTextureGeometry()
Inherited function.
Ogre::RenderOperation
'New' rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::TextAreaOverlayElement::Left
@ Left
Definition: OgreTextAreaOverlayElement.h:48
Ogre::TextAreaOverlayElement::CmdSpaceWidth::doSet
void doSet(void *target, const String &val)
Ogre::TextAreaOverlayElement::setSpaceWidth
void setSpaceWidth(Real width)
Ogre::TextAreaOverlayElement::msCmdSpaceWidth
static CmdSpaceWidth msCmdSpaceWidth
Definition: OgreTextAreaOverlayElement.h:222

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.