OGRE  1.9.0
OgreTextAreaOverlayElement.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2This source file is a part of OGRE
3(Object-oriented Graphics Rendering Engine)
4
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE
25-------------------------------------------------------------------------*/
26
27#ifndef _TextAreaOverlayElement_H__
28#define _TextAreaOverlayElement_H__
29
30#include "OgreOverlayElement.h"
31#include "OgreFont.h"
32
33namespace Ogre
34{
44 {
45 public:
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
217
219
220 // Command objects
228
229
238
243
244
246 void checkMemoryAllocation( size_t numChars );
250 virtual void updateTextureGeometry();
252 virtual void updateColours(void);
253 };
256}
257
258#endif
259
#define _OgreOverlayExport
#define _OgrePrivate
Class representing colour.
Abstract definition of a 2D element to be displayed in an Overlay.
Abstract class which is command object which gets/sets parameters.
'New' rendering operation using vertex buffers.
Command object for setting the alignment.
String doGet(const void *target) const
void doSet(void *target, const String &val)
Command object for setting the caption.
void doSet(void *target, const String &val)
String doGet(const void *target) const
Command object for setting the char height.
void doSet(void *target, const String &val)
String doGet(const void *target) const
Command object for setting the bottom colour.
void doSet(void *target, const String &val)
String doGet(const void *target) const
Command object for setting the top colour.
void doSet(void *target, const String &val)
String doGet(const void *target) const
Command object for setting the constant colour.
void doSet(void *target, const String &val)
String doGet(const void *target) const
Command object for setting the caption.
String doGet(const void *target) const
void doSet(void *target, const String &val)
Command object for setting the width of a space.
void doSet(void *target, const String &val)
String doGet(const void *target) const
This class implements an overlay element which contains simple unformatted text.
const String & getFontName() const
void setCharHeight(Real height)
virtual void updatePositionGeometry()
Inherited function.
void setMetricsMode(GuiMetricsMode gmm)
Overridden from OverlayElement.
void addBaseParameters(void)
Method for setting up base parameters for this class.
void getRenderOperation(RenderOperation &op)
See Renderable.
virtual void updateColours(void)
Updates vertex colours.
void checkMemoryAllocation(size_t numChars)
Internal method to allocate memory, only reallocates when necessary.
void _update(void)
Overridden from OverlayElement.
void setColourTop(const ColourValue &col)
Sets the colour of the top of the letters.
TextAreaOverlayElement(const String &name)
Constructor.
RenderOperation mRenderOp
Render operation.
virtual void initialise(void)
Initialise gui element.
const ColourValue & getColourBottom(void) const
Gets the colour of the bottom of the letters.
void setFontName(const String &font)
const ColourValue & getColourTop(void) const
Gets the colour of the top of the letters.
ColourValue mColourBottom
Colours to use for the vertices.
virtual void setCaption(const DisplayString &text)
Sets the caption on elements that support it.
virtual const String & getTypeName(void) const
See OverlayElement.
Alignment mAlignment
The text alignment.
virtual void updateTextureGeometry()
Inherited function.
const MaterialPtr & getMaterial(void) const
See Renderable.
const ColourValue & getColour(void) const
Gets the colour of the text.
void setColour(const ColourValue &col)
Sets the colour of the text.
bool mTransparent
Flag indicating if this panel should be visual or just group things.
void setColourBottom(const ColourValue &col)
Sets the colour of the bottom of the letters.
void setSpaceWidth(Real width)
void setMaterialName(const String &matName)
Overridden from OverlayElement.
String DisplayString
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
float Real
Software floating point type.
_StringBase String
unsigned short ushort