PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNText.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLSCENE_SCENENODE_TEXT_H__ 00024 #define __PLSCENE_SCENENODE_TEXT_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLGraphics/Color/Color4.h> 00032 #include "PLScene/Scene/SceneNode.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLScene { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Abstract text scene node 00047 */ 00048 class SNText : public SceneNode { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Public definitions ] 00053 //[-------------------------------------------------------] 00054 public: 00055 /** 00056 * @brief 00057 * Scene node flags (SceneNode flags extension) 00058 */ 00059 enum EFlags { 00060 NoCenter = 1<<10 /**< Do not center the text */ 00061 }; 00062 pl_enum(EFlags) 00063 pl_enum_base(SceneNode::EFlags) 00064 pl_enum_value(NoCenter, "Do not center the text") 00065 pl_enum_end 00066 00067 00068 //[-------------------------------------------------------] 00069 //[ RTTI interface ] 00070 //[-------------------------------------------------------] 00071 pl_class(PLS_RTTI_EXPORT, SNText, "PLScene", PLScene::SceneNode, "Abstract text scene node") 00072 // Attributes 00073 pl_attribute(Text, PLCore::String, "", ReadWrite, GetSet, "Text do draw", "") 00074 pl_attribute(Color, PLGraphics::Color4, PLGraphics::Color4(1.0f, 1.0f, 1.0f, 1.0f), ReadWrite, DirectValue, "Text color", "") 00075 pl_attribute(Font, PLCore::String, "", ReadWrite, GetSet, "The used font, if empty the default font is used", "") 00076 pl_attribute(FontSize, PLCore::uint32, 0, ReadWrite, GetSet, "The font size, if null the default font size is used - use scene node scale for dynamic scale", "Max='100'") 00077 // Overwritten SceneNode attributes 00078 pl_attribute(Flags, pl_flag_type(EFlags), 0, ReadWrite, GetSet, "Flags", "") 00079 pl_class_end 00080 00081 00082 //[-------------------------------------------------------] 00083 //[ Public RTTI get/set functions ] 00084 //[-------------------------------------------------------] 00085 public: 00086 PLS_API virtual PLCore::String GetText() const; 00087 PLS_API virtual void SetText(const PLCore::String &sValue); 00088 PLS_API virtual PLCore::String GetFont() const; 00089 PLS_API virtual void SetFont(const PLCore::String &sValue); 00090 PLS_API virtual PLCore::uint32 GetFontSize() const; 00091 PLS_API virtual void SetFontSize(PLCore::uint32 nValue); 00092 00093 00094 //[-------------------------------------------------------] 00095 //[ Protected functions ] 00096 //[-------------------------------------------------------] 00097 protected: 00098 /** 00099 * @brief 00100 * Default constructor 00101 */ 00102 PLS_API SNText(); 00103 00104 /** 00105 * @brief 00106 * Destructor 00107 */ 00108 PLS_API virtual ~SNText(); 00109 00110 00111 //[-------------------------------------------------------] 00112 //[ Private data ] 00113 //[-------------------------------------------------------] 00114 private: 00115 PLCore::String m_sText; /**< Text do draw */ 00116 PLCore::String m_sFont; /**< The used font, if empty the default font is used */ 00117 PLCore::uint32 m_nFontSize; /**< The font size, if null the default font size is used - use scene node scale for dynamic scale */ 00118 00119 00120 }; 00121 00122 00123 //[-------------------------------------------------------] 00124 //[ Namespace ] 00125 //[-------------------------------------------------------] 00126 } // PLScene 00127 00128 00129 #endif // __PLSCENE_SCENENODE_TEXT_H__
|