Skip to main content

FlixelTweenSettings

View source

class

org.flixelgdx.tween.settings.FlixelTweenSettings

public class FlixelTweenSettings

Class for holding basic data, containing configurations to be used on a FlixelTween.

Constructors

FlixelTweenSettings()

public FlixelTweenSettings()

FlixelTweenSettings(FlixelTweenType)

public FlixelTweenSettings(FlixelTweenType type)

Parameters:

NameDescription
typeThe type of tween it should be.

FlixelTweenSettings(FlixelTweenType, FlixelEaseFunction)

public FlixelTweenSettings(FlixelTweenType type, FlixelEaseFunction ease)

Parameters:

NameDescription
typeThe type of tween it should be.
easeThe easer function the tween should use (aka how it should be animated).

Methods

addGoal(FlixelTweenGoalGetter, float, FlixelTweenGoalSetter)

public FlixelTweenSettings addGoal(FlixelTweenGoalGetter getter, float toValue, FlixelTweenGoalSetter setter)

Adds a new tween goal that tweens a value via a getter and setter.

The getter is called once at tween start to capture the initial value. Each subsequent update interpolates from that captured value toward toValue and passes the result to the setter.

Parameters:

NameDescription
getterSupplies the current value of the property at tween start.
toValueThe value to tween the property to.
setterConsumes the interpolated value on every tween update.

Returns: this tween settings object for chaining.


setDuration(float)

public FlixelTweenSettings setDuration(float duration)

Sets the duration of how long the tween should last for.

Parameters:

NameDescription
durationThe new value to set.

Returns: this tween settings object for chaining.


getDuration()

public float getDuration()

getType()

public FlixelTweenType getType()

getEase()

public FlixelEaseFunction getEase()

getOnStart()

public FlixelEaseStartCallback getOnStart()

getOnUpdate()

public FlixelEaseUpdateCallback getOnUpdate()

getOnComplete()

public FlixelEaseCompleteCallback getOnComplete()

getGoals()

public Array<FlixelTweenGoal> getGoals()

getLoopDelay()

public float getLoopDelay()

getStartDelay()

public float getStartDelay()

getFramerate()

public float getFramerate()

setEase(FlixelEaseFunction)

public FlixelTweenSettings setEase(FlixelEaseFunction ease)

clearGoals()

public void clearGoals()

setStartDelay(float)

public FlixelTweenSettings setStartDelay(float startDelay)

setLoopDelay(float)

public FlixelTweenSettings setLoopDelay(float loopDelay)

setFramerate(float)

public FlixelTweenSettings setFramerate(float framerate)

setType(FlixelTweenType)

public FlixelTweenSettings setType(FlixelTweenType type)

setOnStart(FlixelEaseStartCallback)

public FlixelTweenSettings setOnStart(FlixelEaseStartCallback onStart)

setOnUpdate(FlixelEaseUpdateCallback)

public FlixelTweenSettings setOnUpdate(FlixelEaseUpdateCallback onUpdate)

setOnComplete(FlixelEaseCompleteCallback)

public FlixelTweenSettings setOnComplete(FlixelEaseCompleteCallback onComplete)

forEachGoal(FlixelTweenGoalVisitor)

public FlixelTweenSettings forEachGoal(FlixelTweenGoalVisitor visitor)

FlixelTweenGoal

record

org.flixelgdx.tween.settings.FlixelTweenSettings.FlixelTweenGoal

public static final record FlixelTweenGoal(FloatSupplier getter, float toValue, FlixelTweenGoalSetter setter)

A record containing a getter, a target value, and a setter for a property-based tween goal.

Constructors

FlixelTweenGoal(FloatSupplier, float, FlixelTweenGoalSetter)

public FlixelTweenGoal(FloatSupplier getter, float toValue, FlixelTweenGoalSetter setter)

Parameters:

NameDescription
getterSupplies the initial value of the property when the tween starts.
toValueThe value to tween the property to.
setterConsumes the interpolated value on every tween update.

Methods

toString()

public final String toString()

hashCode()

public final int hashCode()

equals(Object)

public final boolean equals(Object o)

getter()

public FloatSupplier getter()

toValue()

public float toValue()

setter()

public FlixelTweenGoalSetter setter()

FlixelTweenGoalVisitor

interface

org.flixelgdx.tween.settings.FlixelTweenSettings.FlixelTweenGoalVisitor

public static interface FlixelTweenGoalVisitor

A functional interface for visiting each goal in this tween settings object.

Methods

visit(FlixelTweenGoal)

public void visit(FlixelTweenGoal goal)