Started on Pump How To Play screen.
Changes to BGAnimations: Metric Configurable Stuff: 1. you can rotate your BGA's 2. You can specify their X 3. You can specify their Y 4. You can make them appear (once) after a set time 5. You can make them hide (once) after a set time (useful if you want an item to show and appear just once) 6. You can set how ZOOMED in the element is. This will only work for sprite 0 in the BGAnimation Layer, I have currently done NO checking should there be more than one sprite in the layer (I suspect only sprite 0 will change and the rest will be unaffected) But again fairly untested. Check out the Pump How To Play screen to see it running. In the works: Tweening With BGAnimations. Haven't quite figured this one yet.
This commit is contained in:
@@ -92,6 +92,16 @@ void BGAnimationLayer::LoadFromVisualization( CString sMoviePath )
|
||||
void BGAnimationLayer::LoadFromAniLayerFile( CString sPath, CString sSongBGPath )
|
||||
{
|
||||
sPath.MakeLower();
|
||||
m_PosX = 0;
|
||||
m_PosY = 0;
|
||||
m_Zoom = 0;
|
||||
m_Rot = 0;
|
||||
m_ShowTime = 0;
|
||||
m_HideTime = 0;
|
||||
m_TweenStartTime = 0;
|
||||
m_TweenX = 0.0;
|
||||
m_TweenY = 0.0;
|
||||
m_TweenSpeed = 0;
|
||||
|
||||
if( sPath.Find("usesongbg") != -1 )
|
||||
{
|
||||
@@ -310,11 +320,42 @@ found_effect:
|
||||
ini.SetPath( sIniPath );
|
||||
if( ini.ReadFile() )
|
||||
{
|
||||
ini.GetValueF( "BGAnimationLayer", "SetXpos", m_PosX );
|
||||
ini.GetValueF( "BGAnimationLayer", "SetYpos", m_PosY );
|
||||
ini.GetValueF( "BGAnimationLayer", "SetZoom", m_Zoom );
|
||||
ini.GetValueF( "BGAnimationLayer", "SetRot", m_Rot );
|
||||
ini.GetValueF( "BGAnimationLayer", "TweenStartTime", m_TweenStartTime );
|
||||
ini.GetValueF( "BGAnimationLayer", "TweenX", m_TweenX );
|
||||
ini.GetValueF( "BGAnimationLayer", "TweenY", m_TweenY );
|
||||
ini.GetValueF( "BGAnimationLayer", "TweenSpeed", m_TweenSpeed );
|
||||
ini.GetValueF( "BGAnimationLayer", "ShowTime", m_ShowTime );
|
||||
ini.GetValueF( "BGAnimationLayer", "HideTime", m_HideTime );
|
||||
ini.GetValueF( "BGAnimationLayer", "TexCoordVelocityX", m_vTexCoordVelocity.x );
|
||||
ini.GetValueF( "BGAnimationLayer", "TexCoordVelocityY", m_vTexCoordVelocity.y );
|
||||
ini.GetValueF( "BGAnimationLayer", "RotationalVelocity", m_fRotationalVelocity );
|
||||
ini.GetValueF( "BGAnimationLayer", "SetY", m_fStretchScrollH_Y );
|
||||
}
|
||||
|
||||
if(m_ShowTime != 0) // they don't want to show until a certain point... hide it all
|
||||
{
|
||||
m_Sprites[0].SetDiffuse(RageColor(0,0,0,0));
|
||||
}
|
||||
if(m_PosX != 0)
|
||||
{
|
||||
m_Sprites[0].SetX(m_PosX);
|
||||
}
|
||||
if(m_PosY != 0)
|
||||
{
|
||||
m_Sprites[0].SetY(m_PosY);
|
||||
}
|
||||
if(m_Zoom != 0)
|
||||
{
|
||||
m_Sprites[0].SetZoom(m_Zoom);
|
||||
}
|
||||
if(m_Rot != 0)
|
||||
{
|
||||
m_Sprites[0].SetRotation(m_Rot);
|
||||
}
|
||||
}
|
||||
|
||||
void BGAnimationLayer::Update( float fDeltaTime )
|
||||
@@ -463,7 +504,7 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
case EFFECT_TILE_SCROLL_LEFT:
|
||||
for( i=0; i<m_iNumSprites; i++ )
|
||||
{
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX() - fDeltaTime * PARTICLE_VELOCITY );
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX() - fDeltaTime * PARTICLE_VELOCITY * (1 + m_vTexCoordVelocity.x) ); // metricable speed :)
|
||||
if( IsOffScreenLeft(&m_Sprites[i]) )
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX()-GetOffScreenLeft(&m_Sprites[i]) + GetOffScreenRight(&m_Sprites[i]) );
|
||||
}
|
||||
@@ -471,7 +512,7 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
case EFFECT_TILE_SCROLL_RIGHT:
|
||||
for( i=0; i<m_iNumSprites; i++ )
|
||||
{
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX() + fDeltaTime * PARTICLE_VELOCITY );
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX() + fDeltaTime * PARTICLE_VELOCITY * (1 + m_vTexCoordVelocity.x) );
|
||||
if( IsOffScreenRight(&m_Sprites[i]) )
|
||||
m_Sprites[i].SetX( m_Sprites[i].GetX()-GetOffScreenRight(&m_Sprites[i]) + GetOffScreenLeft(&m_Sprites[i]) );
|
||||
}
|
||||
@@ -513,6 +554,41 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if(m_TweenStartTime != 0 && !(m_TweenStartTime < 0))
|
||||
{
|
||||
m_TweenStartTime -= fDeltaTime;
|
||||
if(m_TweenStartTime <= 0) // if we've gone past the magic point... show the beast....
|
||||
{
|
||||
// m_Sprites[0].SetTweenXY( m_TweenX, m_TweenY);
|
||||
|
||||
// WHAT WOULD BE NICE HERE:
|
||||
// Set the Sprite Tweening To m_TweenX and m_TweenY
|
||||
// Going as fast as m_TweenSpeed specifies.
|
||||
// however, TWEEN falls over on its face at this point.
|
||||
// Lovely.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(m_ShowTime != 0 && !(m_ShowTime < 0))
|
||||
{
|
||||
m_ShowTime -= fDeltaTime;
|
||||
if(m_ShowTime <= 0) // if we've gone past the magic point... show the beast....
|
||||
{
|
||||
m_Sprites[0].SetDiffuse( RageColor(1,1,1,1) );
|
||||
}
|
||||
}
|
||||
if(m_HideTime != 0 && !(m_HideTime < 0)) // make sure it's not 0 or less than 0...
|
||||
{
|
||||
m_HideTime -= fDeltaTime;
|
||||
if(m_HideTime <= 0) // if we've gone past the magic point... hide the beast....
|
||||
{
|
||||
m_Sprites[0].SetDiffuse( RageColor(0,0,0,0) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void BGAnimationLayer::Draw()
|
||||
|
||||
@@ -80,8 +80,19 @@ protected:
|
||||
RageVector2 m_vHeadings[MAX_SPRITES]; // only used in EFFECT_PARTICLES_BOUNCE
|
||||
|
||||
RageVector2 m_vTexCoordVelocity;
|
||||
float m_PosX;
|
||||
float m_PosY;
|
||||
float m_Zoom;
|
||||
float m_Rot;
|
||||
float m_fRotationalVelocity;
|
||||
float m_fStretchScrollH_Y;
|
||||
float m_ShowTime;
|
||||
float m_HideTime;
|
||||
|
||||
float m_TweenStartTime;
|
||||
float m_TweenX;
|
||||
float m_TweenY;
|
||||
float m_TweenSpeed;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user