当前位置: 首页>>代码示例>>C++>>正文


C++ Timeline::apply方法代码示例

本文整理汇总了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 ) );
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:7,代码来源:Swatch.cpp

示例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 );
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:19,代码来源:Item.cpp

示例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 );
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:19,代码来源:Item.cpp

示例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 ) );
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:22,代码来源:Swatch.cpp

示例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 );
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:39,代码来源:Item.cpp

示例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 );
	}
}
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:37,代码来源:Item.cpp

示例7: mouseOff

void Swatch::mouseOff( Timeline &timeline )
{
	timeline.apply( &mScale, 1.0f, 0.2f, EaseOutAtan( 10 ) );
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:4,代码来源:Swatch.cpp

示例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() );
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:6,代码来源:Character.cpp

示例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 ) );
}
开发者ID:ChristophPacher,项目名称:Cinder,代码行数:6,代码来源:Character.cpp


注:本文中的Timeline::apply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。