Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/render/TextOverlay.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _TEXT_OVERLAY_H_
00004 #define _TEXT_OVERLAY_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <render/Overlay.h>
00009 
00010 #include <string>
00011 
00012 namespace render
00013 {
00014 
00015 class Font;
00016         
00017 enum Alignment
00018 {
00019         A_LEFT,
00020         A_RIGHT,
00021         A_CENTER
00022 };
00023 
00025 class ENGINE_PUBLIC_EXPORT TextOverlay: public Overlay
00026 {
00027 public:
00028 
00029         TextOverlay();
00030         TextOverlay(const std::string& name);
00031 
00032         ~TextOverlay();
00033 
00035         void setFont(const std::string& name);
00036         void setFont(Font* font);
00037 
00038         Material* getMaterial() const;
00039 
00040         void setCaption(const std::string& caption);
00041         const std::string& getCaption() const;
00042 
00043         void setAlignment(Alignment a);
00044         
00045         Alignment getAlignment() const;
00046 
00047         void setCharHeight(f32 height);
00048         f32 getCharHeight() const;
00049 
00050         void setSpaceWidth(f32 width);
00051         f32 getSpaceWidth() const;
00052 
00053 protected:
00054 
00055         void initializeImpl();
00056 
00057         Font* mFont;
00058 
00059         std::string mCaption;
00060 
00062         Alignment mAlignment;
00063 
00064         f32 mCharHeight;
00065         f32 mPixelCharHeight;
00066         f32 mSpaceWidth;
00067         f32 mPixelSpaceWidth;
00068         u32 mAllocSize;
00069         f32 mViewportAspectCoef;
00070 
00071         void initProperties();
00072 
00073         void updateTransformImpl();
00074 
00075         // Internal method to allocate memory, only reallocates when necessary
00076         void allocateMemory(u32 numChars);
00077 
00078         void updatePositionBinding();
00079 
00080         void updateTextureBinding();
00081 };
00082 
00083 } //namespace render
00084 
00085 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:05 by Doxygen (1.7.4)