I know its a very simple function, but its fiddly so I thought I'd post it : ). - It tiles a sprite, all you have to do is pass it the new size you want and the image will repeat itself : ). Very usefull for backgrounds & such (saves using multiple sprites too, so much faster).
Hope it comes in usefull to someone : ).
createTiledSprite(int sprite, int size_x, int size_y){
float tiles_x = (float)size_x / dbSpriteWidth(sprite);
float tiles_y = (float)size_y / dbSpriteHeight(sprite);
dbSizeSprite ( sprite, size_x, size_y );
dbSetSpriteTextureCoordinates ( sprite, 1, tiles_x, 0 );
dbSetSpriteTextureCoordinates ( sprite, 2, 0, tiles_y);
dbSetSpriteTextureCoordinates ( sprite, 3, tiles_x, tiles_y);
}