00001 /* 00002 http://www.opensource.org/licenses/mit-license.php (MIT-License) 00003 00004 Copyright (c) 2007 Lugre-Team 00005 00006 Permission is hereby granted, free of charge, to any person obtaining a copy 00007 of this software and associated documentation files (the "Software"), to deal 00008 in the Software without restriction, including without limitation the rights 00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00010 copies of the Software, and to permit persons to whom the Software is 00011 furnished to do so, subject to the following conditions: 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00019 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00020 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00021 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00022 THE SOFTWARE. 00023 */ 00024 #ifndef LUGRE_ColourClipTextOVERLAY_H 00025 #define LUGRE_ColourClipTextOVERLAY_H 00026 #include "lugre_ColourClipPaneOverlay.h" 00027 #include "lugre_robrenderable.h" 00028 #include <OgrePrerequisites.h> 00029 #include <OgreFont.h> 00030 00031 00032 namespace Lugre { 00033 00034 // temporary name 00035 // see also OgrePanelOverlayElement.cpp 00036 // OgreOverlayElementFactory.h 00037 // ./include/OgreOverlayElementFactory.h 00038 00039 class cColourClipTextOverlay : public cColourClipPaneOverlay { public : 00040 static Ogre::String msTypeName; 00041 Ogre::FontPtr mpFont; 00042 Ogre::Real mViewportAspectCoef; 00043 Ogre::Real mWrapMaxW; 00044 Ogre::Real mCharHeight; 00045 Ogre::Real mSpaceWidth; 00046 Ogre::ushort mPixelCharHeight; 00047 Ogre::ushort mPixelSpaceWidth; 00048 Ogre::ushort mPixelWrapMaxW; 00049 Ogre::ColourValue mColourBottom; 00050 Ogre::ColourValue mColourTop; 00051 Ogre::GuiHorizontalAlignment mAlignment; 00052 00053 cColourClipTextOverlay(const Ogre::String& name); 00054 virtual ~cColourClipTextOverlay(); 00055 00057 static void RegisterFactory (); 00058 00060 virtual const Ogre::String& getTypeName(void) const; 00061 00063 virtual void updatePositionGeometry(void); 00064 00065 void UpdateVars (); 00066 void SetAutoWrap (Ogre::Real fMaxW); 00067 00068 void GetTextBounds (Ogre::Real& w,Ogre::Real& h); 00069 int GetGlyphAtPos (const size_t x,const size_t y); 00070 void GetGlyphBounds (const size_t iIndex,Ogre::Real& l,Ogre::Real& t,Ogre::Real& r,Ogre::Real& b); 00071 00072 inline void setAlignment (const Ogre::GuiHorizontalAlignment align) { mAlignment = align; mGeomPositionsOutOfDate = true; } 00073 00074 // stuff from OgreTextArea... 00075 void setCharHeight (Ogre::Real height ); 00076 void setSpaceWidth (Ogre::Real width ); 00077 void setCaption (const Ogre::UTFString& caption ); 00078 void setFontName (const Ogre::String& font ); 00079 void setColour (const Ogre::ColourValue& col); 00080 void setColourBottom (const Ogre::ColourValue& col); 00081 void setColourTop (const Ogre::ColourValue& col); 00082 00083 Ogre::Real getCharHeight () const; 00084 Ogre::Real getSpaceWidth () const; 00085 const Ogre::UTFString& getCaption () const; 00086 const Ogre::String& getFontName () const; 00087 const Ogre::ColourValue& getColour () const; 00088 const Ogre::ColourValue& getColourBottom () const; 00089 const Ogre::ColourValue& getColourTop () const; 00090 }; 00091 00092 }; 00093 00094 #endif
1.5.6