OgreTextAreaOverlayElement.h
Go to the documentation of this file.
/*-------------------------------------------------------------------------
This source file is a part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE
-------------------------------------------------------------------------*/
#ifndef _TextAreaOverlayElement_H__
#define _TextAreaOverlayElement_H__
#include "OgreOverlayElement.h"
#include "OgreFont.h"
namespace Ogre
{
class _OgreOverlayExport TextAreaOverlayElement : public OverlayElement
{
public:
enum Alignment
{
Left,
Right,
Center
};
public:
TextAreaOverlayElement(const String& name);
virtual ~TextAreaOverlayElement();
virtual void initialise(void);
virtual void setCaption(const DisplayString& text);
void setCharHeight( Real height );
Real getCharHeight() const;
void setSpaceWidth( Real width );
Real getSpaceWidth() const;
void setFontName( const String& font );
const String& getFontName() const;
virtual const String& getTypeName(void) const;
const MaterialPtr& getMaterial(void) const;
void getRenderOperation(RenderOperation& op);
void setMaterialName(const String& matName);
void setColour(const ColourValue& col);
const ColourValue& getColour(void) const;
void setColourBottom(const ColourValue& col);
const ColourValue& getColourBottom(void) const;
void setColourTop(const ColourValue& col);
const ColourValue& getColourTop(void) const;
inline void setAlignment( Alignment a )
{
mAlignment = a;
mGeomPositionsOutOfDate = true;
}
inline Alignment getAlignment() const
{
return mAlignment;
}
void setMetricsMode(GuiMetricsMode gmm);
void _update(void);
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdCaption : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdCharHeight : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdSpaceWidth : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdFontName : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdColourTop : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdColourBottom : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdColour : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
//-----------------------------------------------------------------------------------------
class _OgrePrivate CmdAlignment : public ParamCommand
{
public:
String doGet( const void* target ) const;
void doSet( void* target, const String& val );
};
protected:
Alignment mAlignment;
bool mTransparent;
RenderOperation mRenderOp;
void addBaseParameters(void);
static String msTypeName;
// Command objects
static CmdCharHeight msCmdCharHeight;
static CmdSpaceWidth msCmdSpaceWidth;
static CmdFontName msCmdFontName;
static CmdColour msCmdColour;
static CmdColourTop msCmdColourTop;
static CmdColourBottom msCmdColourBottom;
static CmdAlignment msCmdAlignment;
FontPtr mFont;
Real mCharHeight;
ushort mPixelCharHeight;
Real mSpaceWidth;
ushort mPixelSpaceWidth;
size_t mAllocSize;
Real mViewportAspectCoef;
ColourValue mColourBottom;
ColourValue mColourTop;
bool mColoursChanged;
void checkMemoryAllocation( size_t numChars );
virtual void updatePositionGeometry();
virtual void updateTextureGeometry();
virtual void updateColours(void);
};
}
#endif
Ogre::TextAreaOverlayElement::setAlignment
void setAlignment(Alignment a)
Definition: OgreTextAreaOverlayElement.h:108
Ogre::TextAreaOverlayElement::mColoursChanged
bool mColoursChanged
Definition: OgreTextAreaOverlayElement.h:241
OgreFont.h
Ogre::TextAreaOverlayElement::msCmdSpaceWidth
static CmdSpaceWidth msCmdSpaceWidth
Definition: OgreTextAreaOverlayElement.h:222
Ogre::TextAreaOverlayElement::msCmdColourTop
static CmdColourTop msCmdColourTop
Definition: OgreTextAreaOverlayElement.h:225
Ogre::TextAreaOverlayElement::Alignment
Alignment
Definition: OgreTextAreaOverlayElement.h:46
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:58
Ogre::TextAreaOverlayElement::msCmdColourBottom
static CmdColourBottom msCmdColourBottom
Definition: OgreTextAreaOverlayElement.h:226
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::TextAreaOverlayElement::Left
Definition: OgreTextAreaOverlayElement.h:48
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::TextAreaOverlayElement::getAlignment
Alignment getAlignment() const
Definition: OgreTextAreaOverlayElement.h:113
OgreOverlayElement.h
Ogre::TextAreaOverlayElement::mColourBottom
ColourValue mColourBottom
Colours to use for the vertices.
Definition: OgreTextAreaOverlayElement.h:239
Ogre::TextAreaOverlayElement::mCharHeight
Real mCharHeight
Definition: OgreTextAreaOverlayElement.h:231
Ogre::TextAreaOverlayElement::CmdFontName
Command object for setting the caption.
Definition: OgreTextAreaOverlayElement.h:158
Ogre::TextAreaOverlayElement::CmdColourBottom
Command object for setting the bottom colour.
Definition: OgreTextAreaOverlayElement.h:178
Ogre::TextAreaOverlayElement::Right
Definition: OgreTextAreaOverlayElement.h:49
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::TextAreaOverlayElement::CmdAlignment
Command object for setting the alignment.
Definition: OgreTextAreaOverlayElement.h:198
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::TextAreaOverlayElement::msCmdAlignment
static CmdAlignment msCmdAlignment
Definition: OgreTextAreaOverlayElement.h:227
Ogre::TextAreaOverlayElement
This class implements an overlay element which contains simple unformatted text.
Definition: OgreTextAreaOverlayElement.h:43
Ogre::TextAreaOverlayElement::CmdCaption
Command object for setting the caption.
Definition: OgreTextAreaOverlayElement.h:128
Ogre::TextAreaOverlayElement::mRenderOp
RenderOperation mRenderOp
Render operation.
Definition: OgreTextAreaOverlayElement.h:213
Ogre::TextAreaOverlayElement::mSpaceWidth
Real mSpaceWidth
Definition: OgreTextAreaOverlayElement.h:233
Ogre::TextAreaOverlayElement::mPixelCharHeight
ushort mPixelCharHeight
Definition: OgreTextAreaOverlayElement.h:232
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::TextAreaOverlayElement::CmdSpaceWidth
Command object for setting the width of a space.
Definition: OgreTextAreaOverlayElement.h:148
Ogre::DisplayString
String DisplayString
Definition: OgreOverlayElement.h:53
Ogre::TextAreaOverlayElement::mAllocSize
size_t mAllocSize
Definition: OgreTextAreaOverlayElement.h:235
Ogre::TextAreaOverlayElement::mViewportAspectCoef
Real mViewportAspectCoef
Definition: OgreTextAreaOverlayElement.h:236
Ogre::SharedPtr< Material >
Ogre::TextAreaOverlayElement::CmdCharHeight
Command object for setting the char height.
Definition: OgreTextAreaOverlayElement.h:138
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:108
Ogre::TextAreaOverlayElement::mColourTop
ColourValue mColourTop
Definition: OgreTextAreaOverlayElement.h:240
Ogre::RenderOperation
&#39;New&#39; rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::TextAreaOverlayElement::mPixelSpaceWidth
ushort mPixelSpaceWidth
Definition: OgreTextAreaOverlayElement.h:234
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:79
Ogre::TextAreaOverlayElement::mFont
FontPtr mFont
Definition: OgreTextAreaOverlayElement.h:230
Ogre::TextAreaOverlayElement::msCmdFontName
static CmdFontName msCmdFontName
Definition: OgreTextAreaOverlayElement.h:223
Ogre::TextAreaOverlayElement::msCmdCharHeight
static CmdCharHeight msCmdCharHeight
Definition: OgreTextAreaOverlayElement.h:221
Ogre::TextAreaOverlayElement::CmdColourTop
Command object for setting the top colour.
Definition: OgreTextAreaOverlayElement.h:168
Ogre::TextAreaOverlayElement::CmdColour
Command object for setting the constant colour.
Definition: OgreTextAreaOverlayElement.h:188
Ogre::TextAreaOverlayElement::msTypeName
static String msTypeName
Definition: OgreTextAreaOverlayElement.h:218
Ogre::TextAreaOverlayElement::mAlignment
Alignment mAlignment
The text alignment.
Definition: OgreTextAreaOverlayElement.h:207
Ogre::TextAreaOverlayElement::mTransparent
bool mTransparent
Flag indicating if this panel should be visual or just group things.
Definition: OgreTextAreaOverlayElement.h:210

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