OpacityRampEffect QML Type
A shader effect that applies an opacity fade gradient More...
Import Statement: | import Sailfish.Silica 1.0 |
Properties
Detailed Description
OpacityRampEffect linearly decreases the opacity of an item in a specified direction.
The example below fades the text from top to bottom:
import QtQuick 2.2
import Sailfish.Silica 1.0
Item {
Label {
id: helloText
font.pixelSize: Theme.fontSizeExtraLarge
text: "Hello"
}
OpacityRampEffect {
sourceItem: helloText
direction: OpacityRamp.TopToBottom
}
}
Property Documentation
This direction property determines the direction of the fade:
- OpacityRamp.LeftToRight
- OpacityRamp.RightToLeft
- OpacityRamp.TopToBottom
- OpacityRamp.BottomToTop
- OpacityRamp.BothSides
The default value is OpacityRamp.LeftToRight.
Specifies the distance from the starting edge to begin the ramp down. For example, setting offset: 0.75 with direction: OpacityRamp.LeftToRight will begin fading at 75% of the width of the sourceItem.
The default value is 0.5.
Specifies the rate at which opacity is reduced. A value of 1.0 will ramp the opacity down to 0 over the full width of the sourceItem. A value of 2.0 will reduce the opacity to 0 over half the width of the sourceItem.
The default value is 2.0.
Specifies the Item to which the effect is applied. The OpacityRampEffect cannot be a child of the sourceItem.