| 29 | } |
| 30 | |
| 31 | void Swatch::scatter( Timeline &timeline, float width, float height ) |
| 32 | { |
| 33 | vec2 pos1( 0.0f, mPos().y ); |
| 34 | vec2 pos2( 0.0f, height ); |
| 35 | vec2 pos3 = vec2( Rand::randFloat( width ), Rand::randFloat( height - 50.0f, height + 50.0f ) );//pos2 + rVec; |
| 36 | |
| 37 | float dur = Rand::randFloat( 0.25f, 0.5f ); |
| 38 | |
| 39 | // pos |
| 40 | timeline.apply( &mPos, mPos(), 0.2f, EaseInAtan( 10 ) ).finishFn( bind( &Swatch::setSelected, this ) ); |
| 41 | timeline.appendTo( &mPos, pos2, 0.0001f, EaseNone() ); |
| 42 | timeline.appendTo( &mPos, pos3, dur, EaseOutAtan( 20 ) ); |
| 43 | |
| 44 | // alpha |
| 45 | timeline.apply( &mAlpha, 0.0f, 0.2f, EaseInAtan( 10 ) ); |
| 46 | timeline.appendTo( &mAlpha, 1.0f, dur, EaseOutAtan( 10 ) ); |
| 47 | |
| 48 | // scale |
| 49 | float s = (float)Rand::randInt( 3, 7 ); |
| 50 | timeline.apply( &mScale, 1.0f, 0.2f, EaseInAtan( 10 ) ); |
| 51 | timeline.appendTo( &mScale, s*s, dur, EaseOutAtan( 20 ) ); |
| 52 | } |
| 53 | |
| 54 | void Swatch::assemble( Timeline &timeline ) |
| 55 | { |
no test coverage detected