LoadListOfBitmaps

static std::vector< Bitmap *>
LoadListOfBitmaps(

std::string filenameBegin,
std::string extension,
int numNumbers = 2,
int extraFlags = [none] );

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].Blit200.0100.0 );


Other functions of the class Bitmap
Load
Loads the bitmap
Blit
Draws the Bitmap to the screen
BlitRotated
Draws the Bitmap to the screen rotated along a point
BlitStretched
Draws the Bitmap to the screen stretched to the specified size
BlitTransformed
Draws the Bitmap to the screen rotated and stretched
BlitDistorted
Draws the Bitmap to the screen with the given corner points
Width
Returns the width of the Bitmap
Height
Returns the height of the Bitmap
LoadListOfBitmaps
Loads a list of bitmaps from the disk
GetPixel
Returns the color value of a pixel
Destroy
Destroys the Bitmap
IsValid
Checks if the Bitmap was loaded correctly
Save
Saves the Bitmap to disk with the specified filename
CopyFromScreen
Copies a region of the game window to the Bitmap
GetMemoryBitmap
Returns a memory bitmap copy of (part of) the Bitmap
GetCollisionPoly
Returns the generated collision polygon for the Bitmap
SetDefaultPivot
Sets the default pivot point
GetDefaultPivot
Returns the default pivot point

Advanced functions

GetPixelPacked
Returns the color value of the specified pixel in a packed integer
SendToGPU
Sends the Bitmap to the graphics card
UnloadFromGPU
Unloads the Bitmap from the graphics card
Select
Selects the Bitmap as the active texture of OpenGL
UseAutoDelete
Chooses the Bitmap to be automatically deleted when the program quits
HasAlphaChannel
Checks if the Bitmap has an alpha channel
StartFastBlitting
This function should be called right before using FastBlit
FastBlit
A faster version of Blit
FinishFastBlitting
This function should be called after calling FastBlit
UnloadToMemory
Unloads the Bitmap from the graphics card keeping the image data saved in the Bitmap
TexturedQuad
Outputs a raw textured quad to the video card


Questions about LoadListOfBitmaps? Click here.