+ AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES, distanceField );
+}
+
+void DaliTableView::InitialiseBackgroundActors( Actor actor )
+{
+ // Delete current animations
+ mBackgroundAnimations.clear();
+
+ // Create new animations
+ const Vector3 size = actor.GetTargetSize();
+
+ for( unsigned int i = 0, childCount = actor.GetChildCount(); i < childCount; ++i )
+ {
+ Actor child = actor.GetChildAt( i );
+
+ // Calculate a random position
+ Vector3 childPos( Random::Range( -size.x * 0.5f * BACKGROUND_SPREAD_SCALE, size.x * 0.5f * BACKGROUND_SPREAD_SCALE ),
+ Random::Range( -size.y, size.y ),
+ Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) );
+
+ child.SetPosition( childPos );
+
+ // Define bubble horizontal parallax and vertical wrapping
+ Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ) ) );
+ animConstraint.AddSource( Source( mScrollView, ScrollView::Property::SCROLL_POSITION ) );
+ animConstraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+ animConstraint.AddSource( Dali::LocalSource( Dali::Actor::Property::SIZE ) );
+ animConstraint.Apply();
+
+ // Kickoff animation
+ Animation animation = Animation::New( Random::Range( 40.0f, 80.0f ) );
+ animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunction::LINEAR );
+ animation.SetLooping( true );
+ animation.Play();
+ mBackgroundAnimations.push_back( animation );
+ }