public void getIntersectingSprites ( List < Sprite > list , Shape shape ) { int size = _sprites . size ( ) ; for ( int ii = 0 ; ii < size ; ii ++ ) { Sprite sprite = _sprites . get ( ii ) ; if ( sprite . intersects ( shape ) ) { list . add ( sprite ) ; } } }
When an animated view processes its dirty rectangles it may require an expansion of the dirty region which may in turn require the invalidation of more sprites than were originally invalid . In such cases the animated view can call back to the sprite manager asking it to append the sprites that intersect a particular region to the given list .