Blit
Draws the bitmap to the screen at the specified top-left coordinates. Opacity should be between 0.0 and 1.0, where 1.0 is completely opaque and 0.0 completely transparent. Coordinates are in pixels. Notice that if you don't pass any opacity parameter, the bitmap will be rendered fully opaque. Flipping is now done with FlippedMode. Blit, 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 // playerBmp.Blit( 200.0, 100.0 ); // Draw the bitmap at the same position but with only 40% opacity. // // (You can partially "see through" the bitmap like a ghost) // playerBmp.Blit( 200.0, 100.0, 0.40 ); // Draw the bitmap at the same position but tinted 30% to red // playerBmp.Blit( 200.0, 100.0, TintMode( Rgba( 1.0, 0.0, 0.0, 0.30 ))); // Draw the bitmap at the same position but horizontally flipped // playerBmp.Blit( 200.0, 100.0, FlippedMode( HORIZONTAL )); Other functions of the class Bitmap
Questions about Blit? Click here. |