BlitRotated

float x, float y, float angle, float opacity = 1.0 ) const;

Draws the bitmap to the screen rotated anti-clockwise around its centre. The centre of the bitmap will be positioned in the screen at the given x and y -coordinates.

float x, float y, float angle,
const RenderMode &mode, float opacity = 1.0 ) const;

The same as above but the specified RenderMode affects the way the Bitmap is rendered.

float x, float y, float pivotX, float pivotY,
float angle, float opacity = 1.0 ) const;

Draws the bitmap to the screen rotated clockwise around the point (pivotX, pivotY) in the bitmap. The pivot point will be positioned at the given x and y -coordinates in the screen.

float x, float y, float pivotX, float pivotY,
float angle, const RenderMode &mode,
float opacity = 1.0 ) const;

The same as above but the specified RenderMode affects the way the Bitmap is rendered.

Coordinates are in pixels and the angle is in radians. Opacity should be between 0.0 and 1.0, where 1.0 is completely opaque and 0.0 completely transparent. Notice that if you don't pass any opacity parameter the bitmap will be rendered fully opaque.

If you pass true to horizontallyFlipped the bitmap will be drawn to the screen horizontally flipped. Note that the bitmap will always be placed so that the pivot point is positioned at the given coordinates, even if the bitmap is flipped.

All transformations like rotation use anti-aliased routines by default. Use the Settings if you prefer aliased transformations instead.

BlitRotated, like any other bitmap rendering function, will take the alpha channel of the bitmap in account. With the default blender the alpha channel describes the opacity of every single pixel in the bitmap. The higher alpha value, the more visible the pixel is. Read more about the alpha channel in the definition of Bitmap.

Examples

// Load a bitmap from an image file //
Bitmap playerBmp( "Player.png" );

// Draw the bitmap to the screen such that the top-left corner //
// of the bitmap is positioned at x = 200.0, y = 100.0 //
// and the bitmap is rotated clockwise pi/4 radians (45 decrees) //
playerBmp.BlitRotated200.0100.0, AL_PI/4.0 );

// Draw the bitmap at the same position and rotated similiarily //
// but this time around the top-left corner of the bitmap //
playerBmp.BlitRotated200.0100.00.00.0, AL_PI/4.0 );

// Draw the bitmap at the same position and rotated similiarily as in the first example //
// but with only 70% opacity. (You can partially "see through" the bitmap like if it was a ghost) //
playerBmp.BlitRotated200.0100.0, AL_PI/4.00.70 );


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 BlitRotated? Click here.