OpenLayer Offline Manual

OpenLayer | RenderMode | Gradient Gradient Allows for gradient lighting, shadow and transparency effects.
Gradient( | float topLeftOpacity, float topRightOpacity, float bottomRightOpacity, float bottomLeftOpacity )
Create a gradient mode with different opacity values for each Bitmap corner.
Gradient( | Rgba topLeft, Rgba topRight, Rgba bottomRight, Rgba bottomLeft )
Create a gradient mode with different color channel cofficients 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 )); Parent Class RenderMode Back to the main page of the manual Questions about Gradient? Click here.