Well, animation follows the same idea. For reference, take a look at this texture image:
So, this texture has six frames of animation in it for our swirly circle. To animate it I simply display a different rectangle within the texture on each pass of OnPaint. I made a SimpleAnimatedSprite class to handle these animations. It stores the number of rows and columns of sprites inside the texture, as well as the size of each frame (they all must be the same). Then it just iterates through each image and displays them in order.
This worked perfectly well, but it animated extremely fast so I added another property to my class, the length of time between frames in milliseconds. I made the OnPaint loop display the same frame until the correct amount of time has passed, then move to the next frame and calculate the time for the frame after that one. I was able to successfully control the speed of the spiral, and even make it controllable by the user.
There are a few limitations to this class. First off, all the frames have to be the exact same size, and the frames need to be arranged in the texture image such that the final row of frames is full (you couldn't have seven frames for example). I'll create a ComplexAnimationSprite class to overcome these limitations.


