/* ========================================================================== * ÆÄ ÀÏ : CardImage.h * ¸ñ Àû : Ä«µåÀ̹ÌÁö Ãâ·Â¿ë * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2007-07-31 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Label.h" const int CARD_WIDTH = 120; const int CARD_HEIGHT = 200; class cEffetAniPlane; class cCardParam { public: /// ÅØ½ºÃÄ NiTexture* mpTexture; /// ÁÂÇ¥ cUIPos mTexPos; }; class cCardImage : public cLabel { public: cCardImage( eUINodeType type = eUINODE_LABEL ); virtual ~cCardImage(); enum { eFade_None = 0, eFade_In, eFade_Out, /// È®Àå!! eFade_In_Out, /// fadein -> fadeout eFade_Out_In, /// fadeout -> fadein }; /// bool OnCreate( cUINodeProperty* pproperty ); /// À̹ÌÁö µ¥ÀÌÅÍ ¼¼ÆÃ void SetImage( unsigned long tarotItemIdx, cCardParam* param ); virtual void UpdateRect(); /// À̹ÌÁö µ¥ÀÌÅÍ ¾÷µ¥ÀÌÆ® void UpdateImage(); /// Ä«µå µÚÁý±â void ShowImage( bool show, bool showAni= false, unsigned char fadeState = eFade_None ); bool IsShow() const; /// Ä«µå Á¤¹æÇâ/ ¿ª¹æÇâ void SetDirection( BYTE dir ); /// Ä«µå µÚÁý±â ¶ô void SetLock( bool lock ); inline bool IsLock() { return mLock; } inline unsigned long GetTarotItemIdx() { return mTarotItemIdx; } protected: virtual bool IsValid() const; virtual bool SetSkin(const cUINodeSkin* pskin ); virtual void OnProcess( unsigned long deltaTime, unsigned long accumTime ); virtual void OnRender( cUIFontItemKeeper* pKeeper ); virtual void OnLButtonDown( const cUIPos& pos, bool ctrl, bool AltPress, bool shiftPress ); virtual void OnLButtonDoubleClick( const cUIPos& pos ); virtual void OnMouseLeft(const cUIPos& pos ); virtual void OnMouseHovered(const cUIPos& pos ); virtual bool HandleEvent( const cUIEvent& event ); private: /// À̹ÌÁö µÚÁý±â bool mShowImage; unsigned char mFadeState; unsigned long mAccumTime; unsigned long mFadeTime; /// µÚÁý±â ¶ô bool mLock; /// Ä«µå À̹ÌÁö ÀúÀå cCardParam* mpOpenParam; /// µÞ¸é À̹ÌÁö ÀúÀå cCardParam* mpCloseParam; unsigned long mTarotItemIdx; cEffetAniPlane* mOpenImage; cEffetAniPlane* mCloseImage; cEffetAniPlane* mOverImage; }; inline void cCardImage::SetLock( bool lock ) { mLock = lock; } inline bool cCardImage::IsShow() const { return mShowImage; }