diff LightClone/Source/GuiLabel.h @ 17:4951acfe92fc

Reworking GUI system
author koryspansel <koryspansel@bendbroadband.com>
date Wed, 14 Sep 2011 13:33:22 -0700
parents
children 33cb6979ac51
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LightClone/Source/GuiLabel.h	Wed Sep 14 13:33:22 2011 -0700
@@ -0,0 +1,93 @@
+/*
+ * GuiLabel
+ */
+
+#ifndef __GUILABEL_H__
+#define __GUILABEL_H__
+
+#include "Core.h"
+#include "GuiElement.h"
+
+/*
+ * GuiLabelFlag
+ */
+enum
+{
+	GuiLabelFlag_CenterX	= (1 << 0),
+	GuiLabelFlag_CenterY	= (1 << 1),
+};
+
+/*
+ * GuiLabel
+ */
+class GuiLabel : public GuiElement
+{
+	/*
+	 * MaximumLabelLength
+	 */
+	static const uint32 MaximumLabelLength = 32;
+
+	/*
+	 * pResourceManager
+	 */
+	ResourceManager* pResourceManager;
+
+	/*
+	 * pFont
+	 */
+	ID3DXFont* pFont;
+
+	/*
+	 * kLabel
+	 */
+	char kLabel[MaximumLabelLength];
+
+	/*
+	 * nFlags
+	 */
+	uint32 nFlags;
+
+	/*
+	 * kColor
+	 */
+	D3DCOLOR kColor;
+
+public:
+
+	/*
+	 * GuiLabel
+	 */
+	GuiLabel();
+
+	/*
+	 * Initialize
+	 */
+	virtual ErrorCode Initialize(ResourceManager* pResourceManager);
+
+	/*
+	 * Terminate
+	 */
+	virtual void Terminate();
+
+	/*
+	 * Update
+	 */
+	virtual void Update(float fElapsed);
+
+	/*
+	 * Render
+	 */
+	virtual void Render(RenderContext& kContext);
+
+	/*
+	 * SetFont
+	 */
+	ErrorCode SetFont(const char* pName, uint32 nSize, uint32 nHeight = FW_NORMAL);
+
+	/*
+	 * SetText
+	 */
+	ErrorCode SetText(const char* pText);
+};
+
+#endif //__GUILABEL_H__