本文整理汇总了C++中Timeline::appendTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Timeline::appendTo方法的具体用法?C++ Timeline::appendTo怎么用?C++ Timeline::appendTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timeline
的用法示例。
在下文中一共展示了Timeline::appendTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: select
void Item::select( Timeline &timeline, float leftBorder )
{
if( !mIsSelected ){
mIsBeingSelected = true;
mFadeFloat = 0.0f;
float dur1 = 0.2f;
float dur2 = 0.2f;
// title position
// set selected after initial animation
timeline.apply( &mTitlePos, mTitleDest1, dur1, EaseInAtan( 10 ) ).finishFn( bind( &Item::setSelected, this ) );
timeline.appendTo( &mTitlePos, mTitleDest2 - vec2( 25.0f, 0.0f ), 0.0001f, EaseNone() );
timeline.appendTo( &mTitlePos, mTitleFinish, dur2, EaseOutAtan( 10 ) );
// title color
timeline.apply( &mTitleColor, Color( 1, 1, 1 ), dur1, EaseInQuad() );
// title alpha
timeline.apply( &mTitleAlpha, 0.0f, dur1, EaseInAtan( 10 ) );
timeline.appendTo( &mTitleAlpha, 1.0f, dur2, EaseOutAtan( 10 ) );
// desc position
timeline.apply( &mDescPos, mDescDest, dur2, EaseOutAtan( 10 ) ).timelineEnd( -dur1 );
// desc alpha
timeline.apply( &mDescAlpha, 1.0f, dur2, EaseOutQuad() ).timelineEnd( -dur1*0.5f );
// fadeFloat (used to adjust dropshadow offset)
timeline.apply( &mFadeFloat, 0.0f, dur1, EaseInAtan( 10 ) );
timeline.appendTo( &mFadeFloat, 0.0f, 0.25f, EaseNone() );
timeline.appendTo( &mFadeFloat, 1.0f, dur2, EaseOutQuad() );
// bar width
timeline.apply( &mBarWidth, 0.0f, dur1, EaseInOutAtan( 10 ) );
for( std::vector<Swatch>::iterator swatchIt = mSwatches.begin(); swatchIt != mSwatches.end(); ++swatchIt ) {
swatchIt->scatter( timeline, math<float>::max( mTitleBigTex->getWidth(), 500.0f ), mTitleFinish.y + 50.0f );
}
}
}
示例2: scatter
void Swatch::scatter( Timeline &timeline, float width, float height )
{
vec2 pos1( 0.0f, mPos().y );
vec2 pos2( 0.0f, height );
vec2 pos3 = vec2( Rand::randFloat( width ), Rand::randFloat( height - 50.0f, height + 50.0f ) );//pos2 + rVec;
float dur = Rand::randFloat( 0.25f, 0.5f );
// pos
timeline.apply( &mPos, mPos(), 0.2f, EaseInAtan( 10 ) ).finishFn( bind( &Swatch::setSelected, this ) );
timeline.appendTo( &mPos, pos2, 0.0001f, EaseNone() );
timeline.appendTo( &mPos, pos3, dur, EaseOutAtan( 20 ) );
// alpha
timeline.apply( &mAlpha, 0.0f, 0.2f, EaseInAtan( 10 ) );
timeline.appendTo( &mAlpha, 1.0f, dur, EaseOutAtan( 10 ) );
// scale
float s = (float)Rand::randInt( 3, 7 );
timeline.apply( &mScale, 1.0f, 0.2f, EaseInAtan( 10 ) );
timeline.appendTo( &mScale, s*s, dur, EaseOutAtan( 20 ) );
}
示例3: deselect
void Item::deselect( Timeline &timeline )
{
mIsBeingSelected = false;
float dur1 = 0.2f;
float dur2 = 0.2f;
// set title position
// set deselected after initial animation
timeline.apply( &mTitlePos, mTitleDest2, dur1, EaseInAtan( 10 ) ).finishFn( bind( &Item::setDeselected, this ) );
timeline.appendTo( &mTitlePos, mTitleDest1, 0.0001f, EaseNone() );
timeline.appendTo( &mTitlePos, mTitleStart, dur2, EaseOutElastic( 2.0f, 0.5f ) );
// set title color
timeline.apply( &mTitleColor, Color( 1, 1, 1 ), dur1, EaseInAtan( 10 ) );
timeline.appendTo( &mTitleColor, Color( 0.7f, 0.7f, 0.7f ), 0.05f, EaseOutAtan( 10 ) );
// set title alpha
timeline.apply( &mTitleAlpha, 0.0f, dur1, EaseInAtan( 10 ) );
timeline.appendTo( &mTitleAlpha, 1.0f, dur2, EaseOutAtan( 10 ) );
// set desc position
timeline.apply( &mDescPos, mDescStart, dur1, EaseInAtan( 10 ) ).timelineEnd();
// set desc alpha
timeline.apply( &mDescAlpha, 0.0f, dur1, EaseInQuad() ).timelineEnd( -dur1 );
// set bar
timeline.apply( &mBarWidth, 0.0f, dur1, EaseInAtan( 10 ) );
mBarAlpha = 0.3f;
mIsSelected = false;
for( std::vector<Swatch>::iterator swatchIt = mSwatches.begin(); swatchIt != mSwatches.end(); ++swatchIt ){
swatchIt->assemble( timeline );
}
}