|
From: Charles L. <cn...@us...> - 2009-02-08 21:58:47
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20232/src Modified Files: CopperPrimitives.cpp CopperPrimitives.h Log Message: fix mercury with respect to use imges on buttons. Index: CopperPrimitives.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/CopperPrimitives.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CopperPrimitives.h 5 Nov 2006 06:21:47 -0000 1.9 --- CopperPrimitives.h 8 Feb 2009 21:58:40 -0000 1.10 *************** *** 45,49 **** virtual void Init( CopperWindow * pParent, const MString & sName ); virtual bool MouseEvent( const CopperMouseEvent & pMouseEvent ); ! virtual bool IsFocusable() { return true; } CLASS_RTTI( CopperButton, CopperWindow ); --- 45,49 ---- virtual void Init( CopperWindow * pParent, const MString & sName ); virtual bool MouseEvent( const CopperMouseEvent & pMouseEvent ); ! virtual void Update( const float fDtime ); virtual bool IsFocusable() { return true; } CLASS_RTTI( CopperButton, CopperWindow ); Index: CopperPrimitives.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/CopperPrimitives.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CopperPrimitives.cpp 15 Apr 2007 00:50:40 -0000 1.21 --- CopperPrimitives.cpp 8 Feb 2009 21:58:40 -0000 1.22 *************** *** 94,97 **** --- 94,112 ---- } + void CopperButton::Update( const float fDtime ) + { + //No image loaded (hopefully yet) + if( m_fWidth == 1 ) + { + m_fWidth = float(m_pBGUp.GetWidth()); + m_fHeight = float(m_pBGUp.GetHeight()); + + MercuryPoint pTranslate( m_fWidth/2, m_fHeight/2, 0 ); + m_pBGDown.SetPosition( pTranslate ); + m_pBGUp.SetPosition( pTranslate ); + } + CopperCaption::Update( fDtime ); + } + bool CopperButton::MouseEvent( const CopperMouseEvent & pMouseEvent ) { |