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

Add a ParallaxTarget to run parallax effect.

(Mutable)List<Parallax.PropertyMarkerValue!>!

Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.

(Mutable)List<ParallaxTarget!>!

Returns the list of ParallaxTarget objects.

Unit

Perform mapping from Parallax to list of ParallaxTarget.

Unit

Remove a ParallaxTarget object from the list.

Unit

Sets the list of PropertyMarkerValues, which represents the range of values that source variables can take.

ParallaxEffect!

Add a ParallaxTarget to run parallax effect.

ParallaxEffect!
target(targetObject: Any!, values: PropertyValuesHolder!)

Creates a ParallaxTarget from PropertyValuesHolder and adds it to the list of targets.

ParallaxEffect!
<T, V : Number?> target(targetObject: T!, targetProperty: Property<T!, V!>!)

Creates a ParallaxTarget using direct mapping from source property into target property, the new ParallaxTarget will be added to its list of targets.

Public functions

addTarget

Added in 1.1.0
fun addTarget(target: ParallaxTarget!): Unit

Add a ParallaxTarget to run parallax effect.

Parameters
target: ParallaxTarget!

ParallaxTarget to add.

getPropertyRanges

Added in 1.1.0
fun getPropertyRanges(): (Mutable)List<Parallax.PropertyMarkerValue!>!

Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.

See also
performMapping

getTargets

Added in 1.1.0
fun getTargets(): (Mutable)List<ParallaxTarget!>!

Returns the list of ParallaxTarget objects.

Returns
(Mutable)List<ParallaxTarget!>!

The list of ParallaxTarget objects.

performMapping

Added in 1.1.0
fun performMapping(source: Parallax!): Unit

Perform mapping from Parallax to list of ParallaxTarget.

removeTarget

Added in 1.1.0
fun removeTarget(target: ParallaxTarget!): Unit

Remove a ParallaxTarget object from the list.

Parameters
target: ParallaxTarget!

The ParallaxTarget object to be removed.

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 PropertyMarkerValues.

See also
performMapping

target

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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