/* ========================================================================== * ÆÄ ÀÏ : Label.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2006-10-12 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "UINode.h" #include "UINodeData.h" class cLabel : public cUINode { public: cLabel( eUINodeType type = eUINODE_LABEL ); virtual ~cLabel(); /// ¹®ÀÚ¿­ Ŭ¸®¾î void Clear(); /// ¿ÜºÎ¿¡¼­ °ªÀ» ¼¼ÆÃ ( Á¤¼öÇü, ½Ç¼öÇü µî ) void SetValue( int value ); /// ¿ÜºÎ¿¡¼­ ÅØ½ºÆ®¸¦ ¼¼ÆÃ void SetText( LPCTSTR text ); /// ÅØ½ºÆ® Ä÷¯ ¼¼ÆÃ void SetTextColor( long textColor ); /// ¸ñÇ¥À©µµ¿ì¿¡ Á¤·Ä¹æ¹ýÀ» Á¤ÇØ Á¤·Ä void SetAlign( cUINode* pnode, int align = 0 ); void SetTextPos( cUIPos pos ); /// LPCTSTR GetText() const { return mText.Cstr(); } cUINodeSkin* GetNodeSkin() { return mpSkin; } /// ȸÀü virtual void SetTranslate( short x, short y ); virtual void SetRotate( float angle ); /// ÇØ´ç½ºÅ²À¸·Î À̹ÌÁö ¹Ù²Ù±â void ChangeImage( cUINodeSkin* pSkin ); void ChangeImage( unsigned int texX, unsigned int texY, unsigned int texW, unsigned int texH ); void ChangeImage( unsigned int texX, unsigned int texY ); void SetTexture( NiTexture* pTexture, unsigned int texX, unsigned int texY ); void SetHoverTip( unsigned long tipIndex ); virtual void EnableBoldText( bool set ); // ÆùÆ® ½ºÅ¸ÀÏ void SetFontIndex( unsigned short fontIndex ); protected: virtual void OnProcess( unsigned long deltaTime, unsigned long accumTime ); virtual bool HandleEvent( const cUIEvent& event ); virtual void OnRender( cUIFontItemKeeper* pKeeper ); virtual bool SetSkin( const cUINodeSkin* pskin ); virtual void OnMouseHovered(const cUIPos& pos ); virtual void OnMouseLeft(const cUIPos& pos ); virtual void UpdateRect(); void UpdateText(); protected: /// ÅØ½ºÆ®ÀúÀå typedef tArray cTextLen; cTextLen mTextArr; /// ÅØ½ºÆ® cStringT mText; /// Á¤·ÄÇÒ¶§ ±âÁØÀÌ µÇ´Â ³ëµå cUINode* mDescNode; /// ÅØ½ºÆ® Á¤·Ä int mTextAlign; /// ÅØ½ºÆ® Ãâ·ÂÀ§Ä¡ int mTextPosX, mTextPosY; /// ÅØ½ºÆ® ¼öµ¿ Ãâ·ÂÀ§Ä¡ cUIPos mEditPos; /// Ä÷¯ unsigned long mTextColor; /// ÀÚ½ÅÀÇ ½ºÅ² ÀúÀå cUINodeSkin* mpSkin; // unsigned short mFontIndex; }; inline void cLabel::SetTextColor( long textColor ) { mTextColor = textColor; } inline void cLabel::SetAlign( cUINode* pnode, int align ) { mDescNode = pnode; mTextAlign = align; UpdateText(); } inline void cLabel::SetTextPos( cUIPos pos ) { mEditPos = pos; UpdateText(); } inline void cLabel::SetFontIndex( unsigned short fontIndex ) { mFontIndex = fontIndex; } ////////////////////////////////////////////////////////////////////////// /// Label ½ºÅ² ( static ½ºÅ² ) class cLabelSkin : public cUINodeSkin { public: cLabelSkin( eUINodeType type = eUINODE_LABEL ); virtual ~cLabelSkin(); /// ·Îµù virtual bool Load( cParser& parser ); public: /// ÅØ½ºÆ® cStringT mText; /// ÅØ½ºÆ® Á¤·Ä int mTextAlign; /// ÅØ½ºÆ® Ãâ·ÂÀ§Ä¡¼³Á¤ cUIPos mEditPos; };