本文整理汇总了C++中Timeline::apply方法的典型用法代码示例。如果您正苦于以下问题:C++ Timeline::apply方法的具体用法?C++ Timeline::apply怎么用?C++ Timeline::apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timeline
的用法示例。
在下文中一共展示了Timeline::apply方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assemble
void Swatch::assemble( Timeline &timeline )
{
float dur = 0.2f;
// mPos = mAnchorPos + vec2( 15.0f, 0.0f );
timeline.apply( &mPos, mAnchorPos, dur, EaseOutAtan( 10 ) ).finishFn( bind( &Swatch::setDeselected, this ) );
timeline.apply( &mScale, 1.0f, dur, EaseOutAtan( 10 ) );
}
示例2: mouseOver
void Item::mouseOver( Timeline &timeline )
{
if( !mIsBeingSelected ){
float dur = 0.2f;
// title
timeline.apply( &mTitlePos, mMouseOverDest, dur, EaseOutAtan( 10 ) );
timeline.apply( &mTitleColor, Color( 1, 1, 1 ), 0.05f, EaseOutAtan( 10 ) );
// bar
timeline.apply( &mBarColor, Color( 0, 0, 0 ), dur, EaseOutAtan( 10 ) );
timeline.apply( &mBarAlpha, 0.4f, dur, EaseOutAtan( 10 ) );
timeline.apply( &mBarWidth, mMaxBarWidth, dur, EaseOutAtan( 10 ) );
for( std::vector<Swatch>::iterator swatchIt = mSwatches.begin(); swatchIt != mSwatches.end(); ++swatchIt ) {
swatchIt->mouseOver( timeline );
}
}
}
示例3: mouseOff
void Item::mouseOff( Timeline &timeline )
{
if( !mIsBeingSelected ){
float dur = 0.4f;
// title
timeline.apply( &mTitlePos, mTitleStart, dur, EaseOutBounce( 1.0f ) );
timeline.apply( &mTitleColor, Color( 0.7f, 0.7f, 0.7f ), 0.05f, EaseOutAtan( 10 ) );
// bar
timeline.apply( &mBarColor, Color( 0, 0, 0 ), 0.2f, EaseOutAtan( 10 ) );
timeline.apply( &mBarAlpha, 0.0f, 0.2f, EaseOutAtan( 10 ) );
timeline.apply( &mBarWidth, 0.0f, 0.2f, EaseInAtan( 10 ) );
for( std::vector<Swatch>::iterator swatchIt = mSwatches.begin(); swatchIt != mSwatches.end(); ++swatchIt ) {
swatchIt->mouseOff( timeline );
}
}
}
示例4: 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 ) );
}
示例5: 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 );
}
}
}
示例6: 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 );
}
}
示例7: mouseOff
void Swatch::mouseOff( Timeline &timeline )
{
timeline.apply( &mScale, 1.0f, 0.2f, EaseOutAtan( 10 ) );
}
示例8: animOut
void Character::animOut( Timeline &timeline, mat4 matrix )
{
mDestMatrix = matrix;
timeline.apply( &mColorCur, mColorStart, 1.0f, EaseOutQuad() ).finishFn( bind( &Character::onAnimOut, this ) );
timeline.apply( &mMatrix, matrix, 1.0f, EaseOutQuad() );
}
示例9: animIn
void Character::animIn( Timeline &timeline, mat4 matrix )
{
mDestMatrix = matrix;
timeline.apply( &mColorCur, mColorDest, 1.0f, EaseOutAtan( 20 ) );
timeline.apply( &mMatrix, matrix, 0.5f, EaseOutAtan( 10 ) );
}