Countdown timer with textures ?

Hello guys.

Does anybody know a simple way to create a timer with textures?

I created the textures for the numbers 0 to 9 and I was wondering how to make them work as a timer?

For example the zombieville money counter is using textures, how are they working?

Any help would be appreciated.

I don't know for sure how Zombieville is creating its textures, my guess is that it is a font, but if you need to, you could probably do something like:

var digitSprites : Texture2D[];
//Fill with 10 values 0-9;

function CalculateScore (score : int) : Texture2D[] {
    var scoreImages : Texture2D[] = new Texture2D[3];
    //This would create a value to the 100's.    

    var onesColumn = score % 10;
    scores[0] = digitSprites[onesColumn];

    var tensColumn = (score % 100) - onesColumn;
    tensColumn /= 10;
    scores[1] = digitSprites[tensColumn];

    var hundredsColumn = score % 1000;
    hundredsColumn -= (tensColumn * 10 + onesColumn);
    scores[2] = digitSprites[hundredsColumn];

    return digitSprites;
    //We fill the array in this order so that when we iterate through with a foreach loop the hundreds will be the first value returned.
    //You could made a more generic version of this that could keep score up to any number of digits.

Then it would just be up to you to format the images into the correct spot.