LoadListOfBitmaps
Returns a list of bitmaps stored as filenameBegin01.extension, filenameBegin02.extension etc. where numNumbers is the amount of numbers in the filename. numNumbers actually affects the number of preceeding zeros that will be added to the number in the filename. If numNumbers is 3 the filename should always have at least 3 numbers like in animation015.png and if numNumbers is 5 the filename should be animation00015.png instead. If you don't need any preceeding zeros you can pass 1 as numNumbers. Examples // Load all tile bitmaps from the gfx folder named //
// tile001.bmp, tile002.bmp, tile003.bmp etc. // std::vector< Bitmap *> tileBitmaps = Bitmap::LoadListOfBitmaps( "gfx/tile", "bmp", 3 ); // Check if any bitmaps were actually loaded // if( tileBitmaps.empty() ) { allegro_message( "No tile bitmaps could've been loaded!" ); exit( -1 ); } // Draw the first bitmap such that the top-left coordinate will be at (200, 100) // tileBitmaps[0].Blit( 200.0, 100.0 ); Other functions of the class Bitmap
Questions about LoadListOfBitmaps? Click here. |