ParallaxEffect
abstract class ParallaxEffect
ParallaxEffect class drives changes in ParallaxTarget in response to changes in variables defined in Parallax.
ParallaxEffect has a list of Parallax.PropertyMarkerValues which represents the range of values that source variables can take. The main function is performMapping which computes a fraction between 0 and 1 based on the current values of variables in Parallax. As the parallax effect goes on, the fraction increases from 0 at beginning to 1 at the end. Then the fraction is passed on to update.
App use addEffect to create a ParallaxEffect.
Summary
Public functions |
|
|---|---|
Unit |
addTarget(target: ParallaxTarget!)Add a ParallaxTarget to run parallax effect. |
(Mutable)List<Parallax.PropertyMarkerValue!>! |
Returns the list of |
(Mutable)List<ParallaxTarget!>! |
Returns the list of |
Unit |
performMapping(source: Parallax!)Perform mapping from |
Unit |
removeTarget(target: ParallaxTarget!)Remove a |
Unit |
setPropertyRanges(markerValues: Array<Parallax.PropertyMarkerValue!>!)Sets the list of |
ParallaxEffect! |
target(target: ParallaxTarget!)Add a ParallaxTarget to run parallax effect. |
ParallaxEffect! |
target(targetObject: Any!, values: PropertyValuesHolder!)Creates a |
ParallaxEffect! |
Creates a |
Public functions
addTarget
fun addTarget(target: ParallaxTarget!): Unit
Add a ParallaxTarget to run parallax effect.
| Parameters | |
|---|---|
target: ParallaxTarget! |
ParallaxTarget to add. |
getPropertyRanges
fun getPropertyRanges(): (Mutable)List<Parallax.PropertyMarkerValue!>!
Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.
| Returns | |
|---|---|
(Mutable)List<Parallax.PropertyMarkerValue!>! |
A list of |
| See also | |
|---|---|
performMapping |
getTargets
fun getTargets(): (Mutable)List<ParallaxTarget!>!
Returns the list of ParallaxTarget objects.
| Returns | |
|---|---|
(Mutable)List<ParallaxTarget!>! |
The list of |
performMapping
fun performMapping(source: Parallax!): Unit
Perform mapping from Parallax to list of ParallaxTarget.
removeTarget
fun removeTarget(target: ParallaxTarget!): Unit
Remove a ParallaxTarget object from the list.
| Parameters | |
|---|---|
target: ParallaxTarget! |
The |
setPropertyRanges
fun setPropertyRanges(markerValues: Array<Parallax.PropertyMarkerValue!>!): Unit
Sets the list of PropertyMarkerValues, which represents the range of values that source variables can take.
| Parameters | |
|---|---|
markerValues: Array<Parallax.PropertyMarkerValue!>! |
A list of |
| See also | |
|---|---|
performMapping |
target
fun target(target: ParallaxTarget!): ParallaxEffect!
Add a ParallaxTarget to run parallax effect.
| Parameters | |
|---|---|
target: ParallaxTarget! |
ParallaxTarget to add. |
| Returns | |
|---|---|
ParallaxEffect! |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |
target
fun target(targetObject: Any!, values: PropertyValuesHolder!): ParallaxEffect!
Creates a ParallaxTarget from PropertyValuesHolder and adds it to the list of targets.
| Parameters | |
|---|---|
targetObject: Any! |
Target object for PropertyValuesHolderTarget. |
values: PropertyValuesHolder! |
PropertyValuesHolder for PropertyValuesHolderTarget. |
| Returns | |
|---|---|
ParallaxEffect! |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |
target
fun <T, V : Number?> target(targetObject: T!, targetProperty: Property<T!, V!>!): ParallaxEffect!
Creates a ParallaxTarget using direct mapping from source property into target property, the new ParallaxTarget will be added to its list of targets.
| Parameters | |
|---|---|
<T> |
Type of target object. |
<V : Number?> |
Type of target property value, either Integer or Float. |
targetObject: T! |
Target object for property. |
targetProperty: Property<T!, V!>! |
The target property that will receive values. |
| Returns | |
|---|---|
ParallaxEffect! |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |
| See also | |
|---|---|
isDirectMapping |