no message
This commit is contained in:
@@ -22,15 +22,22 @@
|
||||
|
||||
|
||||
const float HELP_X = CENTER_X;
|
||||
const float HELP_Y = SCREEN_HEIGHT-25;
|
||||
const float HELP_Y = SCREEN_HEIGHT-28;
|
||||
|
||||
const float TIMER_LOCAL_X = 270;
|
||||
const float TIMER_LOCAL_Y = 0;
|
||||
|
||||
MenuElements::MenuElements()
|
||||
{
|
||||
this->AddActor( &m_sprBG );
|
||||
this->AddActor( &m_sprTopEdge );
|
||||
this->AddActor( &m_sprBottomEdge );
|
||||
this->AddActor( &m_textHelp );
|
||||
m_frameTopBar.AddActor( &m_sprTopEdge );
|
||||
m_frameTopBar.AddActor( &m_MenuTimer );
|
||||
|
||||
m_frameBottomBar.AddActor( &m_sprBottomEdge );
|
||||
|
||||
this->AddActor( &m_sprBG );
|
||||
this->AddActor( &m_frameTopBar );
|
||||
this->AddActor( &m_frameBottomBar );
|
||||
this->AddActor( &m_textHelp );
|
||||
}
|
||||
|
||||
void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText )
|
||||
@@ -42,14 +49,18 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
m_sprBG.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
|
||||
m_sprBG.TurnShadowOff();
|
||||
|
||||
m_frameTopBar.SetZ( -1 );
|
||||
|
||||
m_sprTopEdge.Load( sTopEdgePath );
|
||||
m_sprTopEdge.TurnShadowOff();
|
||||
m_sprTopEdge.SetZ( -1 );
|
||||
m_sprTopEdge.SetY( SCREEN_TOP + m_sprTopEdge.GetZoomedHeight()/2.0f );
|
||||
|
||||
m_MenuTimer.SetXY( TIMER_LOCAL_X, TIMER_LOCAL_Y );
|
||||
m_MenuTimer.SetZ( -1 );
|
||||
|
||||
m_frameBottomBar.SetZ( -1 );
|
||||
|
||||
m_sprBottomEdge.Load( THEME->GetPathTo(GRAPHIC_MENU_BOTTOM_EDGE) );
|
||||
m_sprBottomEdge.TurnShadowOff();
|
||||
m_sprBottomEdge.SetZ( -1 );
|
||||
|
||||
m_textHelp.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||
@@ -73,8 +84,8 @@ void MenuElements::TweenTopEdgeOnScreen()
|
||||
{
|
||||
SetTopEdgeOffScreen();
|
||||
|
||||
m_sprTopEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME*2, TWEEN_SPRING );
|
||||
m_sprTopEdge.SetTweenX( CENTER_X );
|
||||
m_frameTopBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME*2, TWEEN_SPRING );
|
||||
m_frameTopBar.SetTweenX( CENTER_X );
|
||||
|
||||
float fOriginalZoomY = m_textHelp.GetZoomY();
|
||||
m_textHelp.SetZoomY( 0 );
|
||||
@@ -86,8 +97,8 @@ void MenuElements::TweenTopEdgeOnScreen()
|
||||
|
||||
void MenuElements::TweenTopEdgeOffScreen()
|
||||
{
|
||||
m_sprTopEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME*2, TWEEN_BIAS_END );
|
||||
m_sprTopEdge.SetTweenX( SCREEN_WIDTH*1.5f );
|
||||
m_frameTopBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME*2, TWEEN_BIAS_END );
|
||||
m_frameTopBar.SetTweenX( SCREEN_WIDTH*1.5f );
|
||||
|
||||
|
||||
m_textHelp.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
@@ -100,8 +111,8 @@ void MenuElements::TweenBackgroundOnScreen()
|
||||
{
|
||||
SetBackgroundOffScreen();
|
||||
|
||||
m_sprBottomEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_sprBottomEdge.SetTweenY( SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
m_frameBottomBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_frameBottomBar.SetTweenY( SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
|
||||
m_sprBG.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
|
||||
m_sprBG.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
@@ -112,8 +123,8 @@ void MenuElements::TweenBackgroundOnScreen()
|
||||
|
||||
void MenuElements::TweenBackgroundOffScreen()
|
||||
{
|
||||
m_sprBottomEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_sprBottomEdge.SetTweenY( SCREEN_HEIGHT + m_sprTopEdge.GetZoomedHeight() );
|
||||
m_frameBottomBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_frameBottomBar.SetTweenY( SCREEN_HEIGHT + m_sprTopEdge.GetZoomedHeight() );
|
||||
|
||||
m_sprBG.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_sprBG.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
@@ -136,22 +147,22 @@ void MenuElements::TweenAllOffScreen()
|
||||
|
||||
void MenuElements::SetBackgroundOnScreen()
|
||||
{
|
||||
m_sprBottomEdge.SetXY( CENTER_X, SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
m_frameBottomBar.SetXY( CENTER_X, SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
}
|
||||
|
||||
void MenuElements::SetBackgroundOffScreen()
|
||||
{
|
||||
m_sprBottomEdge.SetXY( CENTER_X, SCREEN_HEIGHT + m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
m_frameBottomBar.SetXY( CENTER_X, SCREEN_HEIGHT + m_sprBottomEdge.GetZoomedHeight()/2 );
|
||||
}
|
||||
|
||||
void MenuElements::SetTopEdgeOnScreen()
|
||||
{
|
||||
m_sprTopEdge.SetXY( CENTER_X, m_sprTopEdge.GetZoomedHeight()/2 );
|
||||
m_frameTopBar.SetXY( CENTER_X, m_sprTopEdge.GetZoomedHeight()/2 );
|
||||
}
|
||||
|
||||
void MenuElements::SetTopEdgeOffScreen()
|
||||
{
|
||||
m_sprTopEdge.SetXY( CENTER_X+SCREEN_WIDTH, m_sprTopEdge.GetZoomedHeight()/2 );
|
||||
m_frameTopBar.SetXY( CENTER_X+SCREEN_WIDTH, m_sprTopEdge.GetZoomedHeight()/2 );
|
||||
}
|
||||
|
||||
|
||||
@@ -162,8 +173,8 @@ void MenuElements::DrawPrimitives()
|
||||
|
||||
void MenuElements::DrawTopLayer()
|
||||
{
|
||||
m_sprTopEdge.Draw();
|
||||
m_sprBottomEdge.Draw();
|
||||
m_frameTopBar.Draw();
|
||||
m_frameBottomBar.Draw();
|
||||
m_textHelp.Draw();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user