Beta Documentation - Subject to change.
Specifies a blending method.
Fields
| Name | Description |
---|
 | AlphaBlend | Overlays the source over the destination using the source alpha to interpolate between the source and destination colors. |
 | Color | Performs a blend between a new color generated by applying the hue and saturation of the source and the color value of the destination. The new color and the destination color are then interpolated between using the source alpha. |
 | Grayscale | Compute a new color by copying the max of R,G, and B to all three color channels. This new color is then blended with the destination color based on the source alpha. |
 | Multiply | Computes a new color by multiplying each color channel by the source color channel and then interpolating between the new color and the destination color based on the source alpha. Multiply will never brighten a pixel. |
 | None | None. |
 | Normal | Uses the source color value. |
 | Overlay | Overlays the source over the destination. If the source alpha is zero destination color will remain unchanged, for any other alpha value the source color replaces the destination. |
 | Screen | Compute a new color by multiplying the inverses of each color channel by the inverse of the source color channel and then inverting the result. The new color is then blended with the destination color based on the source alpha. Screen will never darken a pixel. |
 | Undefined | Specifies no blending. |
Remarks
Examples
This example demonstrates how a control background image can be blended with a color.
Blending a background image | Copy Code |
---|
testWindow = Turbine.UI.Window();
testWindow:SetPosition( 100, 100 );
testWindow:SetSize( 40, 40 );
testWindow:SetVisible( true );
testIcon = Turbine.UI.Control();
testIcon:SetParent( testWindow );
testIcon:SetBackground( "Resources/StatusIcon.tga" );
testIcon:SetSize( 40, 40 );
testIcon:SetBackColor( Turbine.UI.Color( 1, 1, 0, 0 ) );
testIcon.MouseClick = function( sender, args )
statusIcon:SetBlendMode( ( testIcon:GetBlendMode() + 1 ) % 9 );
end
|
See Also