Gradient Allows for gradient lighting, shadow and transparency effects.
Create a gradient mode with different opacity values for each Bitmap corner. Examples // Load a bitmap //
Bitmap myBmp( ... ); // Render the bitmap to the screen such as the top-left corner is at x = 200.0, y = 100.0 // // and the transparency of the Bitmap changes gradually from full opaque (top) // // to full transparent (bottom) // myBmp.Blit( 200.0, 100.0, Gradient( 1.0, 1.0, 0.0, 0.0 )); // Render the bitmap at the same position such as the lightness of the Bitmap changes gradually // // from dark (lower-left corner) to normal brightness (top-right corner) // Rgba lightnessInDark( 0.3, 0.3, 0.3 ); Rgba lightnessInBright( 1.0, 1.0, 1.0 ); // Make an even mix of the darkness and bright cofficients // Rgba lightnessInMiddle = lightnessInDark.MixWith( lightnessInBright, 0.5 ); myBmp.Blit( 200.0, 100.0, Gradient( lightnessInMiddle, lightnessInBright, lightnessInMiddle, lightnessInDark )); |